2.0 有何新变化

Asciidoctor 2.0 系列补丁版本中的新功能、改进和错误修复。版本按从新到旧的顺序排列。

已解决的累积问题: 2.0.x

Asciidoctor 2.0.20

发布日期 2023.05.18

错误修复

  • 发布时更新 README 和 man 页中的 release-version 属性

  • 发布时重新生成 man 页

Asciidoctor 2.0.19

发布日期 2023.05.17

改进

  • 如果原始或字面块没有行,则返回空字符串而不是 nil

  • 在 man 页输出中,不要将节标题中的等宽跨度大写 (#4402)

  • 通过分离隐式和显式匹配来简化隐式链接(即自动链接)的处理

  • 一致地生成 partintro 块 (#4450)

  • 为内置标签添加斯瓦希里语翻译 (PR #4454) (@bkmgit)

合规性

  • 修复调用顺序,以便在使用 Ruby >= 3.2.0 时,使用无效编码的 include 文件仍会引发错误

  • 修复 fallback Rouge 样式表的测试断言,以兼容 Rouge 4.1 (#4406) (@tmzullinger)

  • 支持节上的 notitle 选项,作为 untitled 的替代方案来隐藏标题 (#4437)

  • 为模板转换器添加对 Haml 6 的支持 (#4429)

错误修复

  • 处理等宽跨度内的受约束的内联直通 (#4458)

  • 即使已解析的 reftext 为空,也要通过 anchor 宏定义 Catalog inline ref

  • 使用 while 循环而不是递归来定位下一个要处理的行;防止堆栈溢出错误 (#4368)

  • 在查找 xref 目标的 # 时,避免匹配数字字符引用 (#4393)

  • 使用正确的选择器来折叠侧边栏第一个和最后一个子元素的边距

  • 不要允许 include 指令的目标以空格开头(以区分 dlist 条目)或以空格结尾

  • man 页输出中的块图像的 alt 文本 manify (#4401)

  • 调整水平 dlist 中术语的字体大小,使其与常规 dlist 中术语的字体大小匹配

  • 隐式附加以块属性行开头的嵌套列表到 dlist 条目 (#4268)

  • 处理转义的 URL 宏时,不要吞噬方括号

  • 在 JRuby 上运行时,将 uri:classloader: 视为绝对路径前缀 (#3929)

  • 将 reftext 替换应用于 DocBook 输出中 mantitle 属性的值 (#4448)

  • 在 DocBook 输出(用于 man 页)中,将 <reftext> 标签包含在 <article> 标签中 (#4452)

  • 正确处理带有 box attrlist 或格式化文本被转义的等宽和受约束的直通的 compat role

构建/基础设施

  • 将 CI 工作流中的最新 CRuby 更新到 3.2

  • 将 CI 工作流中的最新 JRuby 更新到 9.4.2.0

Asciidoctor 2.0.18

发布日期 2022.10.15

错误修复

  • 将内部 uriish? 帮助程序更改为仅在字符串开头检测 URI 模式;避免误导性消息 (#4357)

  • 在未设置源块语言时,防止 highlight.js 警告;如果 data-lang 属性不存在,则不调用 highlightBlock (#4263)

  • 如果 Asciidoctor::Extensions.unregister 在组初始化之前被调用,则不要引发错误 (#4270)

  • 如果路径部分包含和完整包含,则在文档目录的 includes 表中将其存储为 true 值(完整包含)

  • 如果 registry 再次被调用 activate,则重置 registry (#4256)

  • 在扩展代码格式错误时,在异常消息中格式化源位置

  • 当设置了 skip-front-matter 属性但未找到 front matter 的结尾时,修复 reader 上的 lineno

  • 当第一个参数是 hash 时,修复 Asciidoctor::Cli::Invoker 构造函数

  • 更新默认样式表以在无序列表的第一个和最后一个子项上响应标记,当标记在祖先无序列表上定义时 (#4361)

改进

  • :to_dir 选项传播到 AsciiDoc 表格单元格的文档 (#4297)

  • 在转码失败时,强制通过 CLI 传递的属性数据编码为 UTF-8 (#4351) (@zkaip)

Asciidoctor 2.0.17

发布日期 2022.01.05

错误修复

  • 如果自定义块的 process 方法返回一个上下文为 :compound 的抽象块,但该块不是 Block 类型(例如列表),则不要崩溃

  • 如果自定义块或块宏的 process 方法的返回值与父参数匹配,则忽略返回值

  • 在 Pygments 样式表中删除未命名空间的选择器

  • 标准化 Pygments 的输出,使用 linenos 类用于内联行号,并去除数字后的空格;相应更新默认样式表

  • AbstractBlock#sections? 上返回 false 时,当该方法在非 Section 或 Document 的块上调用时 (PR #3591) (@Mogztter)

  • 在使用默认样式表时,在 Safari 中隐藏 HTML 摘要元素上的内置标记 (#4162)

  • 在 Safari 中激活时,隐藏 HTML 摘要周围的轮廓 (#4162)

  • 在嵌入 YouTube 视频时,将主要视频包含在 playlist 属性的值中 (#4156)

  • 响应嵌套表上的 stripes=none (#4165)

  • 更新默认样式表以修复空列表项周围的间距 (#4184)

  • 在使用 man 页 doctype 解析文档时,响应 :header_only 选项 (#4192)

  • 在图标的 alt 文本周围使用数字字符引用来表示闭合方括号

  • 当隐式 doctitle 不存在时,在文档标题中处理 authorauthors 文档属性 (#4206)

  • 修补 open-uri-cached gem 以与 Ruby 3.1 一起使用(更新:现在 open-uri-cached 已修复,请删除修补)(#4227)

改进

  • 防止 HTML 输出中的源块的行号被选中(适用于 pygments 和 coderay)(#4128)

  • 允许通过视频 ID 或使用 hash 属性为 Vimeo 视频指定 hash (#4176)

  • 删除默认样式表中用于样式化列表项内 p 元素的过多特异性

  • 从默认样式表中删除过时的 gist 嵌入样式

  • 允许将 --failure-level 设置为默认值 FATAL

  • 按升序对 --failure-level 选项的帮助信息中的级别进行排序

  • 反转 FR 中 caution & warning 警告标签的翻译 (#4212) (@cyChop)

  • 添加针对 open-uri-cached 集成的测试,该集成由 cache-uri 属性激活

  • 在 include 文件中找不到否定标签时,不要发出警告 (#4230)

构建/基础设施

  • 将 Ruby 3.1 添加到 CI 矩阵

Asciidoctor 2.0.16

发布日期 2021.08.03

错误修复

  • 当 include 指令的 tag 过滤器是单个否定标签时,包含指定标记区域外的所有行 (#4048)

  • 当 include 指令的 tag 过滤器中的否定通配符前面有其他标签时,才将其解释为隐式 globstar (#4086)

  • 当比较操作无法执行时,将 ifeval 指令更改为解析为 false (#4046)

  • :to_file 选项被传递给 loadload_file 且值为非字符串时,不要崩溃 (#4055)

  • 如果简写 xref 中的 ID 后跟一个悬空的逗号(例如 <<idname,>>),则使用自动链接文本

  • 更新默认样式表以缩进附加到 checklist 中列表项的块 (#2550)

  • 更新默认样式表以重新启用 AsciiDoc 表格单元格内 preamble 中第一个段落的隐式 lead role 的样式

  • 更新默认样式表以修复 abbr[title] 元素上的文本装饰与底部边框之间的冲突

  • 将默认样式表中无效的字体系列 "sans" 更改为 "sans-serif"

  • 修复 man 页输出中内部 xref 缺失的自动 reftext (#4110)

  • 在 man 页输出中,将加号的数字字符引用替换为加号 (#4059)

  • 在 man 页输出中,将度数符号的数字字符引用替换为度数符号 (#4059)

  • 将撇号转换为可移植的 \*(Aq 变量,而不是 groff 特定的转义 \(aq (#4060) (@felipec)

  • 在 man 页中记录 -e, --embedded 选项标志,该标志取代了过时的 -e, --eruby 选项标志

改进

  • 使用队列迭代 reader 中的行,而不是堆栈 (#4106)

  • 在 man 页输出中,如果 reftext 匹配节标题,则将 2 级节标题的自动 reftext 大写 (#4110)

  • 在 CLI 帮助中按严格顺序显示安全模式

  • 从默认样式表中删除冗余样式

  • 更新默认样式表中摘要元素的字体样式,以匹配段落的字体样式 (#4114)

  • 更新默认样式表以缩进 details 元素的內容 (#4116)

  • 更新默认样式表,使用自定义标记来表示摘要元素,使其外观一致 (#4116)

  • 添加越南语翻译的内置属性 (PR #4066) (@nguyenhoa93)

  • 添加泰语翻译的内置属性 (PR #4113) (@ammaneena)

构建/基础设施

  • 将默认样式表的源导入此存储库;使用 PostCSS 和 cssnano 进行最小化处理 (#4062)

  • 使用 autoprefixer 管理默认样式表中的浏览器前缀 (#4118)

Asciidoctor 2.0.15

发布日期 2021.04.27

错误修复

  • 在自动链接的目标(URL)中,不要包含末尾的句号、问号或感叹号 (#3860)

  • 在解析 attrlist 时,不要将 nil 值赋给映射到缺失的位置属性的命名属性 (#4033)

  • 删除短语内行内短语(使用旧语法定义并后跟逗号)周围的空格 (#4035)

  • 忽略使用旧语法定义的短语内行内短语,该短语后跟逗号 (#4035)

  • 在 HTML 输出中,对于解析为当前文档的文档间 xref,当未提供链接文本时,使用 xreftext 作为文档作为后备链接文本 (#4032)

  • 在 HTML 输出中,对于具有空片段的内部 xref,当未提供链接文本时,使用 xreftext 作为文档作为后备链接文本 (#4032)

  • 在 DocBook 输出中,对于具有空片段的内部 xref,使用文档 ID 作为 linkend;如有必要,则自动生成一个 (#4032)

改进

  • 在 man 页输出中,将键盘引用格式化为等宽

构建和基础设施

  • 使 JRuby 9.1 for Windows 上的其余 invoker 测试能够正常工作

Asciidoctor 2.0.14

发布日期 2021.04.19

错误修复

  • 不要允许 AsciiDoc 表格单元格设置 API 中已取消设置的文档属性(包括:compat-mode, toc, showtitle, 和 notitle)(#4017)

  • 确保在父文档中已取消设置的默认文档属性在 AsciiDoc 表格单元格中保持未设置状态 (#2586)

  • 如果 showtitlenotitle 在父文档中已设置,则允许在 AsciiDoc 表格单元格中切换它们 (#4018)

  • 确保输入文件的 mtime 在 JRuby for Windows 上遵循 TZ 环境变量(影响 docdatetime 属性的值)(#3550)

  • 即使相应的 *-caption 文档属性(例如 example-caption)未设置,也要响应支持带标题的块的 caption 属性 (#4023)

  • 在对固有 doctitle 属性的赋值应用到隐式文档标题的替换时,抑制缺失属性警告 (#4024)

    如果你想在文档标题(即 0 级节标题)中使用属性引用,并且你还需要在文档中的某个地方引用 doctitle 属性,那么你在文档标题中引用的任何属性都必须在该行之前定义(即遵循文档顺序,就像任何其他属性条目一样)。否则,它们将在 doctitle 属性的值中保持未解析(尽管它们在文档标题本身中仍然有效)。

改进

  • 即使计数器尚未注册,如果设置了属性,也将其用作计数器的种子值 (#4014)

  • 允许由自定义内联宏的 process 方法返回的 Inline 节点上的 subs 属性值为 String (#3938)

  • 允许通过 API 或 CLI 覆盖 user-home 属性的值 (#3732)

构建和基础设施

  • 在 JRuby for Windows 上运行测试 (#3550)

Asciidoctor 2.0.13

发布日期 2021.04.10

错误修复

  • 回滚 #3470 的更改,该更改添加了删除 AsciiDoc include 文件中前导和尾随空行的逻辑;而是跳过空行,然后处理文档标题 (#3997)

  • 不要允许 countercounter2 属性指令覆盖锁定的属性 (#3939) (@mogztter)

  • 修复了在使用非数字值进行计数时,解析序列中的下一个值时发生的崩溃 (#3940)

  • 响应 include 指令后面的标签列表,即使它们被否定 (#3932)

  • 更新默认样式表,从嵌套引用块上的 cite 前面删除连字符 (#3847)

  • 在 man 页输出中大写节标题时,不要篡改格式宏 (#3892)

  • 在 man 页输出中,不要转义 manname 中的连字符

  • 在 man 页输出的 verse 块内容之前删除多余的 .sp

  • 修复 man 页输出中的脚注布局 (#3989)

  • 修复 man 页输出中带有 URL 的脚注文本格式 (#3988)

  • 在 man 页输出中,删除 URL 后跟非相邻文本的 URL 上的多余尾随空格 (#4004)

  • 在 man 页输出中,在分页符位置使用 .bp 宏 (#3992)

改进

  • 提取方法以在 Rouge 适配器中创建 lexer 和 formatter (#3953) (@Oblomov)

  • 添加对 pygments.rb 2.x 的支持 (#3969) (@slonopotamus)

  • 允许通过将 :logger 选项设置为假值来启用 NullLogger (#3982)

  • 在 man 页 doctype 的 NAME 部分的 manpurpose 中替换属性 (#4000)

  • 输出 man 页 doctype 的 HTML 输出中的 name 部分的所有 mannames (#3757)

构建和基础设施

  • 启用以 root 身份运行测试 (PR #3874) (@mikemckiernan)

  • 将 processor 的文档导入 Asciidoctor 核心存储库 (#3861) (@graphitefriction)

  • 通过使用 Bundler 缓存来加快 CI 速度 (PR #3901) (@slonopotamus)

  • 运行测试以同时支持 pygments.rb 1.x 和 2.x (#3969) (@slonopotamus)

文档

  • 多次编辑和拼写修正 (PR #3858)(PR #3912)(PR #3913) (@mogztter)

  • 通过删除 toc-title 首字母的变音符号并添加 partsection 的翻译来改进荷兰语翻译 (PR #3895) (@jdevreese)

  • 更新 attributes-it.adoc (PR #3886) (@ciampix)

  • options.adoc 中更正扩展注册错误 (PR #3902) (@djencks)

  • 对 docs features page 进行少量改进 (PR #3917) (@Younes-L)

  • 添加白俄罗斯语翻译的内置属性 (PR #3928) (@morganov)

  • 记录 header_only 选项 (PR #3934) (@mogztter)

  • 添加使用 docker 的 pandoc 命令,并更新 MS Word 迁移页上的命令 (PR #3956) (@dacog)

  • 对默认样式表文档应用少量拼写和流程更改 (PR #3977) (@chrisperrault)

  • 更新 Confluence XHTML 迁移说明 (#3994) (@juliojgd)

Asciidoctor 2.0.12

发布日期 2020.11.10

错误修复

  • 为未解析的脚注引用设置 typetarget 属性,并取消设置 id 属性(修复回归)(#3825)

  • 在内联 SVG 时,如果图像节点上的显式宽度或高度值不是字符串,则修复崩溃 (#3829)

  • 将表格的自动换行行为重置为 normal,然后再次启用表格内容、水平 dlist 描述和 AsciiDoc 表格单元格的自动换行 (#3833)

改进

  • 将 role 直通到 DocBook 输出中的内联图像 (#3832)

合规性

  • 将 Ruby >= 2.3 的构造推迟使用,以恢复与 Ruby 2.0 的兼容性,直到至少下一个次要版本 (#3827)

  • 在内联 SVG 时,不要将默认的 px 单位标识符附加到显式宽度或高度值 (#3829)

构建和基础设施

  • 将 Linux CI 作业迁移到 GitHub Actions (#3837)

  • 将 Windows CI 作业迁移到 GitHub Actions (#3839)

  • 在 macOS 上运行 CI 作业 (#3842)

Asciidoctor 2.0.11

发布日期 2020.11.02

错误修复

  • 当列表项内发现具有过时语法的 callout 列表时,修复无限循环 (#3472)

  • 在 HTML 和 man 页转换器中,当 xreftext 包含循环引用路径时,修复无限循环 (#3543)

  • 当列具有 al 样式时,将文本格式应用于隐式标题行的表格单元格 (#3760)

  • 在兼容模式下运行时,修复有效引用的错误引用警告 (#3555)

  • 为转换器初始化后端特性(如果之前未初始化),使用已分配的 basebackend;模仿 Asciidoctor < 2 的行为 (#3341)

  • 当启用了 sourcemap 选项时,为 preamble 块设置 source_location (#3799)

  • 链接 notitleshowtitle 属性,使它们成为同一切换的对立面 (#3804)

  • 将选项传递给 Rouge lexer 的构造函数,而不是 #lex 方法;恢复与 Rouge >= 3.4 的兼容性 (#3336)

  • 启用 Rouge PHP lexer 上的 start_inline 选项时,不要覆盖语言上的 cgi-style 选项 (#3336)

  • 修复已包装链接和 xref 文本的解析,包括检测到 attrlist 签名时 (#3331)

  • 恢复 AbstractBlock 上已弃用的可写数字属性

  • 始终将 title 用作 xreftext,如果目标块具有空标题,无论 xrefstyle 值如何 (#3745)

  • 允许在脚注中使用书目引用 (#3325)

  • 修复 AsciiDoc 表格单元格上的底部边距折叠 (#3370)

  • 删除多行 AsciiMath 块中多余的硬换行符 (#3407)

  • 仅从 AsciiDoc include 文件的行中剥离尾随空格 (#3436)

  • 删除菜单宏的正则表达式中多余的可选标志,该标志破坏了 Asciidoctor.js (#3433)

  • 在生成 man 页输出时保留重复的反斜杠 (#3456)

  • 响应内联 SVG 宏上指定的百分比宽度 (#3464)

  • 删除 AsciiDoc include 文件中前导和尾随的空白行,以匹配解析器的假设 (#3470)

  • :extensions 选项设置时,即使 Extensions API 尚未加载,也要激活扩展 (#3570)

  • 如果 :extensions 选项为 false,则不要激活全局扩展 (#3570)

  • 在 man 页输出中,在行开头转义省略号 (#3645) (@jnavila)

  • 如果脚注 ID 已注册,则不要注册具有该 ID 的脚注 (#3690)

  • 在 man 页输出中,响应有序列表的 start 属性 (#3714)

  • 如果内联 SVG 为空,则发出警告而不是崩溃 (#3638) (@mogztter)

  • start 属性值相对于源块计算高亮行范围 (#3519) (@mogztter)

  • 通过分配空标题来防止可折叠块增加示例编号 (#3639)

  • 使用 highlight.js 的自定义 init 函数来选择正确的 code 元素 (#3761)

  • :to_file:to_dir 选项都设置为绝对路径时,修复 :to_dir 的解析值 (#3778)

  • 如果 stylesheets 属性的值包含一个文件夹,并且样式表的目录不存在(即使设置了 :mkdirs 选项),则修复崩溃 (#3808)

  • 如果 API 传递的 copycss 属性值不是字符串,则修复崩溃 (#3592)

  • 恢复 DocBook 输出中书目条目前面的标签,该标签被 #3085 的修复丢弃 (#3782)

  • 在 HTML 输出中,将最大宽度应用于每个顶层容器而不是 body (#3513)

  • 在 HTML 中,不要将 border-collapse: 设置为 separate,用于表块;修复 colspanrowspan 边界处的双边框 (#3793) (@ahus1)

  • 不要删除行中最后一个表格单元格的右边框 (#2563)

  • 重新设计表格边框以利用边框折叠(将 frame 边框应用于表,grid 边框应用于单元格,并选择性地覆盖单元格上的边框以适应 frame)(#3387)

合规性

  • 为自托管视频添加对 muted 选项的支持 (#3408)

  • 将用于转换时语法高亮(coderay、rouge、pygments)的 <style> 元素移动到 head 中 (#3462)

  • 将用于客户端语法高亮(highlight.js、prettify)的 <style> 元素移动到 head 中 (#3503)

  • 将入口 API 方法(loadconvertload_fileconvert_file)定义为类方法而不是 module_function,以避免与 Kernel.load 冲突 (#3625)

  • 保留 HTML code 元素上源代码块的属性顺序,以与 Asciidoctor 1.5.x 的输出保持一致 (#3786)

  • 将韩语文件的语言代码从 kr 修正为 ko (#3807) (@jnavila)

改进

  • 在默认样式表中对 body 应用自动换行(即 word-wrap: anywhere)(#3544)

  • 允许在任何内联元素上使用 nobreaknowrap 角色 (#3544)

  • pre-wrap 角色添加 CSS 类以支持保留短语中的前导、尾随和重复空格 (#3815)

  • 在未启用图标时,保留 XML 风格的 callout 周围的保护符 (#3319)

  • 在 man 页输出中使用 .fam C 命令将字面块的字体系列切换为等宽文本 (#3561)

  • 在 DocBook 转换器中删除表格单元格上 halignvalign 属性的冗余测试

  • 允许使用 encoding 属性指定 include 文件的编码 (#3248)

  • 允许使用模板覆盖轮廓,只需指定轮廓模板 (#3491)

  • 将 MathJax 从 2.7.5 升级到 2.7.9

  • 将 highlight.js 从 9.15.10 升级到 9.18.3(请注意,这会增加脚本大小,从 48.8 KB 增加到 71.5 KB)

  • 跳过嵌入文档未使用的默认属性赋值

  • 允许 URL 宏前面有一个单引号或双引号 (#3376)

  • 添加对 erubi 模板引擎的支持;在测试套件中用它替换 erubis;请注意 erubis 的使用已被弃用 (#3737)

  • 如果设置了 allow-uri-read,则下载并嵌入远程自定义样式表 (#3765)

  • 从默认样式表中删除 direction 属性 (#3753) (@abdnh)

  • 为打印介质删除默认样式表中内容列的最大宽度设置 (#3802)

  • 在 HTML 输出中,将 frame 值 topbot 标准化为 "ends"(一致使用 frame-ends 类)(#3797)

  • AbstractNode 上添加 role 设置方法 (#3614)

  • 将 locale 属性文件中的 chapter-signifierpart-signifier 属性映射到替换 chapter-labelpart-label (#3817)

构建和基础设施

  • 在 TruffleRuby nightly 上运行测试套件 (@mogztter, @erebor)

  • 将 TruffleRuby 升级到 20.0.0 (@mogztter)

  • 在 GitHub Actions 中触发 AsciidoctorJ 的上游构建 (@robertpanzer)

Asciidoctor 2.0.10

发布日期 2019.05.31

错误修复

  • 修复 Asciidoctor.convert_file 时,当写入文件时 header_footer: false 选项不生效的问题 (#3316)

  • 修复 excerpt 块上标题的位置 (#3289)

  • 始终将相同的选项传递给 SyntaxHighlighter#docinfo,无论 location 参数的值如何

  • 修复 SyntaxHighlighter#docinfo 方法的签名 (#3300)

  • icons 设置为 image 时,启用图像图标,但不要将其用作 icontype 属性的值 (#3308)

Asciidoctor 2.0.9

发布日期 2019.04.30

错误修复

  • 处理同一行中的多个单项菜单宏 (#3279)

  • 正确注册 Catalog 中的图像 (#3283)

  • AbstractNode#options 方法重命名为 AbstractNode#enabled_options,以避免与 Document#options 发生命名冲突 (#3282)

  • 当块或内联图像未设置 alt 属性时(通常由扩展程序设置),不要导致文档转换失败

  • 修复跟随分离的列表续接的块的源代码位置的 lineno (#3281)

  • 假定内联图像类型为图像(如果未由扩展程序设置)

Asciidoctor 2.0.8

发布日期 2019.04.22

错误修复

  • 恢复默认样式表应用于字面块的背景色 (#3258)

  • 在内置转换器(DocBook5 和 ManPage)中定义的正则表达式中使用可移植常量(CC_ALLCC_ANY

  • 在自定义内联宏的正则表达式中使用可移植常量(CC_ANY

  • 为 AsciiDoc 表格单元格内容使用更智能的边距折叠;防止直通内容被截断 (#3256)

  • 不要将脚注引用限制为 ASCII 字符集;允许使用 Unicode 中的任何单词字符 (#3269)

改进

  • register_for 方法接受符号作为参数 (#3274)

  • 在模板转换器中使用 Concurrent::Map 而不是 Concurrent::Hash

  • 使用 module_function 关键字定义 Helpers 中的方法

  • 将正则表达式定义移至单独的源文件(内部更改)

Asciidoctor 2.0.7

发布日期 2019.04.13

错误修复

  • 修复从文本解析 ID 时发生的崩溃,其中至少一个候选包含未解析的 xref (#3254)

  • 修复与 Rouge 2.0 的兼容性

改进

  • 改进 -a CLI 选项的文档;解释 @ 修饰符可以放在名称末尾,作为值末尾的替代

  • 将主 API 入口点(loadload_fileconvertconvert_file)的源移至单独的文件(内部更改)

  • 将主 API 入口点(loadload_fileconvertconvert_file)定义为模块函数

Asciidoctor 2.0.6

发布日期 2019.04.04

错误修复

  • 假设在没有扩展名的文档间 xref 宏目标上存在隐式的 AsciiDoc 扩展(例如 document#);恢复 Asciidoctor 1.5.x 的行为 (#3231)

  • Dir.home 调用失败时,不要阻止应用程序加载;使用 rescue 并提供回退值 (#3238)

  • Helpers.rootname 应该只考虑最后一个路径段,然后删除文件扩展名

改进

  • Helpers.extname 实现为比 File.extname 更高效、更灵活的方法

  • 使用 end_with? 检查 AsciiDoc 文件扩展名,而不是解析 extname 并进行查找

Asciidoctor 2.0.5

发布日期 2019.04.01

错误修复

  • 当源高亮器是 Rouge 且源语言未在块上设置时,修复崩溃 (#3223)

  • 更新 CLI 和 SyntaxHighlighter,以便 Asciidoctor 可以在 Ruby 2.0 - 2.2 上干净地加载

  • CLI 应使用 $stdin 而不是 STDIN,以与 $stdout 的使用保持一致

  • 将 CLI 中使用的 stdio 对象的编码标记为 UTF-8 (#3225)

  • Asciidoctor::SyntaxHighlighter::Config.register_for 方法公开,如文档所示

Asciidoctor 2.0.4

发布日期 2019.03.31

错误修复

  • 允许 Asciidoctor 在 Ruby 2.0 - 2.2 上干净地加载,以支持提供这些旧 Ruby 版本的发行版

  • Asciidoctor::Converter::Config.register_for 方法公开,如文档所示

  • 删除未使用的 Asciidoctor::Converter::BackendTraits#derive_backend_traits 私有方法

  • Asciidoctor::Converter::BackendTraits.derive_backend_traits 方法移动到 Asciidoctor::Converter

  • 在 API 文档中将 renderrender_file 方法标记为已弃用

Asciidoctor 2.0.3

发布日期 2019.03.28

错误修复

  • 修复在字面等宽短语上使用属性列表时发生的崩溃 (#3216)

  • 更新魔术正则表达式变量的使用,以修复与 Opal / Asciidoctor.js 的兼容性 (#3214)

Asciidoctor 2.0.2

发布日期 2019.03.26

错误修复

  • 将字面段落应用于列表项的附加段落 (#3205)

  • Table::Cell 上基于单元格文本实现 #lines#source 方法 (#3207)

Asciidoctor 2.0.1

发布日期 2019.03.25

错误修复

  • 将包含属性引用的 Catalog 块和节节点的标题转换为贪婪模式,以在范围内解析属性 (#3202)

  • 自定义 MathJax(使用 postfilter hook)以将 displaymath 格式应用于 AsciiMath 块 (#2498)

  • 修复已弃用的 default_attrs DSL 函数的拼写错误(缺少尾随的 "s")

  • 删除 DocinfoProcessor 类上未使用的 location 属性(attr_accessor :location

  • 如果 :positional_attrs 选项缺失,则查找已弃用的扩展选项 :pos_attrs (#3199)

  • 如果路径与 gem 名称不同,则向加载错误消息添加详细信息 (#1884)

构建和基础设施

  • 将 .yardopts 打包到 RubyGem 中 (#3193)

Asciidoctor 2.0.0

发布日期 2019.03.22

增强功能和合规性

  • 放弃对 Ruby < 2.3 和 JRuby < 9.1 的支持,并删除变通方法 (#2764)

  • 放弃对 Slim < 3 的支持 (#2998)

  • 从核心中删除 docbook45 后端的转换器;已移至 github.com/asciidoctor/asciidoctor-docbook45 (#3005)

  • normal 替换顺序中将替换应用于节和块标题 (#1173)

  • 使语法高亮器可插拔;将所有逻辑提取到适配器类中 (#2106)

  • 添加 Rouge 的语法高亮器适配器 (#1040)

  • Redesign Converter API based on SyntaxHighlighter API; remap deprecated API to new API to ensure compatibility (#2891)

  • Repurpose built-in converters as regular converters (#2891)

  • Make registration and resolution of global converters thread-safe (#2891)

  • Fold the default converter factory into the Converter module (#2891)

  • Add a default implementation for Converter#convert in the Base converter (#2891)

  • Rename Converter::BackendInfo to Converter::BackendTraits; map backend_info to new backend_traits method (#2891)

  • Allow built-in converter classes to be resolved using Converter.for and instantiated using Converter.create (#2891)

  • Allow converter factory to be passed using :converter_factory API option (#2891)

  • Honor htmlsyntax if defined on converter (#2891)

  • Add backend_traits_source keyword argument to CompositeConverter constructor (#2891)

  • Add support for start attribute when using prettify to highlight source blocks with line numbering enabled

  • Use String#encode to encode String as UTF-8 instead of using String#force_encoding (#2764)

  • Add FILE_READ_MODE, URI_READ_MODE, and FILE_WRITE_MODE constants to control open mode when reading files and URIs and writing files (#2764)

  • Set visibility of private and protected methods (#2764)

  • Always run docinfo processor extensions regardless of safe mode (gives control to extension) (#2966)

  • Use infinitive verb form for extension DSL method names; map deprecated method names where appropriate

  • Add docinfo insertion slot for header location to built-in converters (#1720)

  • Add support for the muted option on Vimeo videos (allows autoplay to work in Chrome) (#3014)

  • Use value of prettify-theme attribute as is if it starts with http:// or https:// (#3020)

  • Allow icontype to be set using icons attribute (#2953)

  • When using a server-side syntax highlighter, highlight content of source block even if source language is not set (#3027)

  • Automatically promote a listing block without an explicit style to a source block if source-language is set (#1117)

  • Remove the 2-character (i.e., "") quote block syntax

  • Don’t allow block role to inherit from document attribute; only look for role in block attributes (#1944)

  • Split out functionality of -w CLI flag (script warnings) from -v CLI flag (verbose logging) (#3030)

  • Log possible invalid references at info level (#3030)

  • Log dropped lines at info level when attribute-missing=drop-line (#2861)

  • Honor attribute-missing setting when processing include directives and block macros (#2855)

  • Log warning when include directive is not resolved due to missing attribute or blank target; always include warning in output document (#2868)

  • Use the third argument of AbstractNode#attr / AbstractNode#attr? to set the name of a fallback attribute to look for on the document (#1934)

  • Change default value of third argument to Abstractnode#attr / AbstractNode#attr? to nil so attribute doesn’t inherit by default (#3059)

  • Look for table-frame, table-grid, and table-stripes attributes on document as fallback for frame, grid, and stripes attributes on table (#3059)

  • Add support for hover mode for table stripes (stripes=hover) (#3110)

  • Always assume the target of a shorthand inter-document xref is a reference to an AsciiDoc document (source-to-source) (#3021)

  • If the target of a formal xref macro has a file extension, assume it’s a path reference (#3021)

  • Never assume target of a formal xref macro is a path reference unless a file extension or fragment is present (#3021)

  • Encode characters in URI to comply with RFC-3986

  • Implement full support for styled xreftext in man page converter (#3077)

  • Allow the id and role properties to be set on a list item of ordered and unordered lists via the API (#2840)

  • Yield processor instance to registration block for document processor if block has non-zero arity (i.e., has parameters)

  • Add Document#parsed? method to check whether document has been parsed

  • Modify Cell class to extend from AbstractBlock instead of AbstractNode (#2963)

  • Implement block? and inline? methods on Column, both which return false (#2963)

  • Drop verse table cell style (treat as normal table cell) (#3111)

  • Allow negated subs to be specified on inline pass macro (#2191)

  • Log warning if footnoteref macro is found and compat mode is not enabled (#3114)

  • Log info message if inline macro processor returns a String value (#3176)

  • Apply subs to Inline node returned by inline macro processor if subs attribute is specified (#3178)

  • Add create_inline_pass helper method to base extension processor class (#3178)

  • Log debug message instead of warning if block style is unknown (#3092)

  • Allow backend to delegate to a registered backend using the syntax synthetic:delegate when using custom templates (e.g., slides:html) (#891)

  • AbstractBlock#find_by looks inside AsciiDoc table cells if traverse_documents selector option is true (#3101)

  • AbstractBlock#find_by finds table cells, which can be selected using the :table_cell context in the selector (#2524)

  • Allow ampersand to be used in email address (#2553)

  • Propagate ID assigned to inline passthrough (#2912)

  • Rename control keywords in find_by to better align with the standard NodeFilter terminology

  • Stop find_by iteration if filter block returns :stop directive

  • Rename header_footer option to standalone (while still honoring header_footer for backwards compatibility) (#1444)

  • Replace anchors and xrefs before footnotes (replace footnotes last in macros substitution group)

  • Apply substitution for custom inline macro before all other macros

  • Only promote index terms automatically (A, B, C becomes A > B > C + B > C + C) if indexterm-promotion option is set on document (#1487)

  • Add support for see and see-also on index terms; parse attributes on indexterm macros if text contains = (#2047)

  • Drop :indexterms table from document catalog (in preparation for solution to #450 in a 2.x release)

  • Load additional languages for highlight.js as defined in the comma-separated highlightjs-languages attribute (#3036)

  • Log warning if conditional expression in ifeval directive is invalid (#3161)

  • Drop lines that contain an invalid preprocessor directive (#3161)

  • Rename AbstractBlock#find_by directives; use :prune in place of :skip_children and :reject in place of :skip

  • Convert example block into details/summary tag set if collapsible option is set; open by default if open option is set (#1699)

  • Substitute replacements in author values used in document header (#2441)

  • Require space after semicolon that separates multiple authors (#2441)

  • Catalog inline anchors at start of callout list items (#2818) (@owenh000)

  • Add parse_attributes helper method to base extension Processor class (#2134)

改进

  • Propagate document ID to DocBook output (#3011)

  • Always store section numeral as string; compute Roman numeral for part at assignment time (@vmj)

  • Refactor code to use modern Hash syntax

  • Define LIB_DIR constant; rename *_PATH constants to *_DIR constants to be consistent with RubyGems terminology (#2764)

  • Only define ROOT_DIR if not already defined (for compatibility with Asciidoctor.js)

  • Move custom docinfo content in footer below built-in docinfo content in footer in HTML converter (#3017)

  • Read and write files using File methods instead of IO methods (#2995)

  • Value comparison in AbstractNode#attr? is only performed if expected value is truthy

  • Align default CodeRay style with style for other syntax highlighters (#2106)

  • Ensure linenos class is added to linenos column when source highlighter is pygments and pygments-css=style

  • Disable table stripes by default (#3110)

  • Rename CSS class of Pygments line numbering table to linenotable (to align with Rouge) (#1040)

  • Remove unused Converter#convert_with_options method (#2891)

  • Add -e, --embedded CLI flag as alias for -s, --no-header-footer (require long option to specify eRuby implementation) (#1444)

  • Don’t store the options attribute on the block once the options are parsed (#3051)

  • Add an options method on AbstractNode to retrieve the set of option names (#3051)

  • Pass :input_mtime option to Document constructor; let Document constructor assign docdate/time/year attributes (#3029)

  • Never mutate strings; add a frozen_string_literal: true magic comment to top of all Ruby source files (#3054)

  • Always use docdate and doctime to compute docyear and docdatetime (#3064)

  • Rename PreprocessorReader#exceeded_max_depth? to PreprocessorReader#exceeds_max_depth? and return nil if includes are disabled

  • Stop populating :ids table in document catalog (#3084)

  • Always use :refs table in document catalog to look for registered IDs (#3084)

  • Don’t compute and store reference text in document catalog (#3084)

  • Populate reference text table lazily for resolving ID by reference text (#3084)

  • Don’t store fallback reference text on :bibref node (#3085)

  • Call AbstractNode#reftext instead of AbstractNode#text to retrieve reference text for bibref node (#3085)

  • Only map unparsed attrlist of inline macro to target when format is short

  • Add clearer exception message when source data is binary or has invalid encoding (#2884)

  • Rename context for table cell and table column to :table_cell and :table_column, respectively

  • Rename hardbreaks document attribute to hardbreaks-option; retain hardbreaks as a deprecated alias (#3123)

  • Extend TLD for implicit email addresses to 5 characters (#3154)

  • Truncate with precision (instead of rounding) when computing absolute width for columns in DocBook output (#3131)

  • Drop legacy LaTeX math delimiters (e.g, $..$) if present (#1339)

  • Use proper terminology in warning message about mismatched preprocessor directive (#3165)

  • Rename low-level extension attribute name :pos_attrs to :positional_attrs

  • Mark default_attrs extension DSL method deprecated in favor of default_attributes

  • Upgrade MathJax to 2.7.5

Bug fixes

  • Fix crash caused by inline passthrough macro with the macros sub clearing the remaining passthrough placeholders (#3089)

  • Fix crash if ifeval directive is missing expression (#3164)

  • Prevent relative leveloffset from making section level negative and causing hang (#3152)

  • Don’t fail to parse Markdown-style quote block that only contains attribution line (#2989)

  • Enforce rule that Setext section title must have at least one alphanumeric character; fixes problem with block nested inside quote block (#3060)

  • Apply header substitutions to doctitle value when assigning it back to the doctitle document attribute (#3106)

  • Don’t fail if value of pygments-style attribute is not recognized; gracefully fallback to default style (#2106)

  • Do not alter the $LOAD_PATH (#2764)

  • Fix crash if stem block is empty (#3118)

  • Remove conditional comment for IE in output of built-in HTML converter; fixes sidebar table of contents (#2983)

  • Fix styling of source blocks with linenums enabled when using prettify as syntax highlighter (#640)

  • Update default stylesheet to support prettify themes (#3020)

  • Remove hard-coded color values on source blocks in default stylesheet (#3020)

  • Add fallback if relative path cannot be computed because the paths are located on different drives (#2944)

  • Ignore explicit section level style (#1852)

  • Don’t eat space before callout number in source block if line-comment attribute is empty (#3121)

  • Check if type is defined in a way that’s compatible with autoload

  • Fix invalid check for DSL in extension class (previously always returned true)

  • Scope constant lookups (#2764)

  • Use byteslice instead of slice to remove BOM from string (#2764)

  • Don’t fail if value of -a CLI option is empty string or equals sign (#2997)

  • Allow failure level of CLI to be set to info

  • Reader#push_include should not fail if data is nil

  • Fix deprecated ERB trim mode that was causing warning (#3006)

  • Move time anchor after query string on Vimeo video to avoid dropping options

  • Allow color for generic text, line numbers, and line number border to inherit from Pygments style (#2106)

  • Enforce and report relative include depth properly (depth=0 rather than depth=1 disables nested includes)

  • Allow outfilesuffix to be soft set from API (#2640)

  • Don’t split paragraphs in table cell at line that resolves to blank if adjacent to other non-blank lines (#2963)

  • Initialize the level to WARN when instantiating the NullLogger

  • next_adjacent_block should not fail when called on dlist item (#3133)

  • Don’t suppress browser styles for summary tag; add pointer cursor and panel margin bottom (#3155)

  • Only consider TLDs in email address that have ASCII alpha characters

  • Allow underscore in domain of email address

Build and infrastructure

  • Clear SOURCE_DATE_EPOCH env var when testing timezones (PR #2969) (@aerostitch)

  • Remove compat folder (removes the AsciiDoc.py config file that provides pseudo-compliance with Asciidoctor and a stylesheet for an old Font Awesome migration)

  • Add Ruby 2.6.0 to build matrix

  • Stop running CI job on unsupported versions of Ruby

  • Exclude test suite, build script, and Gemfile from gem (#3044)

  • Split build tasks out into individual files