2.0 有何新变化
Asciidoctor 2.0 系列补丁版本中的新功能、改进和错误修复。版本按从新到旧的顺序排列。
已解决的累积问题: 2.0.x
Asciidoctor 2.0.20
发布日期 2023.05.18
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
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)
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 不存在时,在文档标题中处理
author或authors文档属性 (#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)
Asciidoctor 2.0.16
发布日期 2021.08.03
错误修复
-
当 include 指令的 tag 过滤器是单个否定标签时,包含指定标记区域外的所有行 (#4048)
-
当 include 指令的 tag 过滤器中的否定通配符前面有其他标签时,才将其解释为隐式 globstar (#4086)
-
当比较操作无法执行时,将
ifeval指令更改为解析为 false (#4046) -
当
:to_file选项被传递给load或load_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)
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)
Asciidoctor 2.0.14
发布日期 2021.04.19
错误修复
-
不要允许 AsciiDoc 表格单元格设置 API 中已取消设置的文档属性(包括:compat-mode, toc, showtitle, 和 notitle)(#4017)
-
确保在父文档中已取消设置的默认文档属性在 AsciiDoc 表格单元格中保持未设置状态 (#2586)
-
如果
showtitle和notitle在父文档中已设置,则允许在 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)
Asciidoctor 2.0.13
发布日期 2021.04.10
错误修复
-
回滚 #3470 的更改,该更改添加了删除 AsciiDoc include 文件中前导和尾随空行的逻辑;而是跳过空行,然后处理文档标题 (#3997)
-
不要允许
counter和counter2属性指令覆盖锁定的属性 (#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首字母的变音符号并添加part和section的翻译来改进荷兰语翻译 (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
错误修复
-
为未解析的脚注引用设置
type和target属性,并取消设置id属性(修复回归)(#3825) -
在内联 SVG 时,如果图像节点上的显式宽度或高度值不是字符串,则修复崩溃 (#3829)
-
将表格的自动换行行为重置为 normal,然后再次启用表格内容、水平 dlist 描述和 AsciiDoc 表格单元格的自动换行 (#3833)
合规性
-
将 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)
-
当列具有
a或l样式时,将文本格式应用于隐式标题行的表格单元格 (#3760) -
在兼容模式下运行时,修复有效引用的错误引用警告 (#3555)
-
为转换器初始化后端特性(如果之前未初始化),使用已分配的 basebackend;模仿 Asciidoctor < 2 的行为 (#3341)
-
当启用了
sourcemap选项时,为 preamble 块设置source_location(#3799) -
链接
notitle和showtitle属性,使它们成为同一切换的对立面 (#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,用于表块;修复colspan和rowspan边界处的双边框 (#3793) (@ahus1) -
不要删除行中最后一个表格单元格的右边框 (#2563)
-
重新设计表格边框以利用边框折叠(将 frame 边框应用于表,grid 边框应用于单元格,并选择性地覆盖单元格上的边框以适应 frame)(#3387)
合规性
-
为自托管视频添加对
muted选项的支持 (#3408) -
将用于转换时语法高亮(coderay、rouge、pygments)的
<style>元素移动到 head 中 (#3462) -
将用于客户端语法高亮(highlight.js、prettify)的
<style>元素移动到 head 中 (#3503) -
将入口 API 方法(
load、convert、load_file、convert_file)定义为类方法而不是module_function,以避免与Kernel.load冲突 (#3625) -
保留 HTML
code元素上源代码块的属性顺序,以与 Asciidoctor 1.5.x 的输出保持一致 (#3786) -
将韩语文件的语言代码从
kr修正为ko(#3807) (@jnavila)
改进
-
在默认样式表中对 body 应用自动换行(即
word-wrap: anywhere)(#3544) -
允许在任何内联元素上使用
nobreak和nowrap角色 (#3544) -
向
pre-wrap角色添加 CSS 类以支持保留短语中的前导、尾随和重复空格 (#3815) -
在未启用图标时,保留 XML 风格的 callout 周围的保护符 (#3319)
-
在 man 页输出中使用
.fam C命令将字面块的字体系列切换为等宽文本 (#3561) -
在 DocBook 转换器中删除表格单元格上
halign和valign属性的冗余测试 -
允许使用
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-signifier和part-signifier属性映射到替换chapter-label和part-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_ALL、CC_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
改进
-
改进
-aCLI 选项的文档;解释@修饰符可以放在名称末尾,作为值末尾的替代 -
将主 API 入口点(
load、load_file、convert、convert_file)的源移至单独的文件(内部更改) -
将主 API 入口点(
load、load_file、convert、convert_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 文档中将
render和render_file方法标记为已弃用
Asciidoctor 2.0.3
发布日期 2019.03.28
Asciidoctor 2.0.2
发布日期 2019.03.26
Asciidoctor 2.0.1
发布日期 2019.03.25
错误修复
-
将包含属性引用的 Catalog 块和节节点的标题转换为贪婪模式,以在范围内解析属性 (#3202)
-
自定义 MathJax(使用
postfilterhook)以将displaymath格式应用于 AsciiMath 块 (#2498) -
修复已弃用的
default_attrsDSL 函数的拼写错误(缺少尾随的 "s") -
删除
DocinfoProcessor类上未使用的 location 属性(attr_accessor :location) -
如果
:positional_attrs选项缺失,则查找已弃用的扩展选项:pos_attrs(#3199) -
如果路径与 gem 名称不同,则向加载错误消息添加详细信息 (#1884)
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#convertin the Base converter (#2891) -
Rename
Converter::BackendInfotoConverter::BackendTraits; mapbackend_infoto newbackend_traitsmethod (#2891) -
Allow built-in converter classes to be resolved using
Converter.forand instantiated usingConverter.create(#2891) -
Allow converter factory to be passed using
:converter_factoryAPI option (#2891) -
Honor
htmlsyntaxif defined on converter (#2891) -
Add
backend_traits_sourcekeyword argument toCompositeConverterconstructor (#2891) -
Add support for
startattribute when using prettify to highlight source blocks with line numbering enabled -
Use
String#encodeto encode String as UTF-8 instead of usingString#force_encoding(#2764) -
Add
FILE_READ_MODE,URI_READ_MODE, andFILE_WRITE_MODEconstants 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
mutedoption on Vimeo videos (allowsautoplayto work in Chrome) (#3014) -
Use value of
prettify-themeattribute as is if it starts with http:// or https:// (#3020) -
Allow
icontypeto be set usingiconsattribute (#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-languageis 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
-wCLI flag (script warnings) from-vCLI 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-missingsetting 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?tonilso attribute doesn’t inherit by default (#3059) -
Look for
table-frame,table-grid, andtable-stripesattributes on document as fallback forframe,grid, andstripesattributes 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
idandroleproperties 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
Cellclass to extend fromAbstractBlockinstead ofAbstractNode(#2963) -
Implement
block?andinline?methods onColumn, both which returnfalse(#2963) -
Drop
versetable cell style (treat as normal table cell) (#3111) -
Allow negated
substo be specified on inline pass macro (#2191) -
Log warning if
footnoterefmacro is found and compat mode is not enabled (#3114) -
Log info message if inline macro processor returns a String value (#3176)
-
Apply
substoInlinenode returned by inline macro processor ifsubsattribute is specified (#3178) -
Add
create_inline_passhelper 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:delegatewhen using custom templates (e.g.,slides:html) (#891) -
AbstractBlock#find_bylooks inside AsciiDoc table cells iftraverse_documentsselector option istrue(#3101) -
AbstractBlock#find_byfinds table cells, which can be selected using the:table_cellcontext 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_byto better align with the standardNodeFilterterminology -
Stop
find_byiteration if filter block returns:stopdirective -
Rename
header_footeroption to standalone (while still honoringheader_footerfor 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-promotionoption is set on document (#1487) -
Add support for
seeandsee-alsoon index terms; parse attributes onindextermmacros if text contains=(#2047) -
Drop
:indextermstable 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-languagesattribute (#3036) -
Log warning if conditional expression in
ifevaldirective is invalid (#3161) -
Drop lines that contain an invalid preprocessor directive (#3161)
-
Rename
AbstractBlock#find_bydirectives; use:prunein place of:skip_childrenand:rejectin place of:skip -
Convert example block into details/summary tag set if
collapsibleoption is set; open by default ifopenoption 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_attributeshelper method to base extensionProcessorclass (#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_DIRconstant; rename *_PATH constants to *_DIR constants to be consistent with RubyGems terminology (#2764) -
Only define
ROOT_DIRif 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
linenosclass is added tolinenoscolumn when source highlighter ispygmentsandpygments-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_optionsmethod (#2891) -
Add
-e,--embeddedCLI flag as alias for-s, --no-header-footer(require long option to specify eRuby implementation) (#1444) -
Don’t store the
optionsattribute on the block once the options are parsed (#3051) -
Add an
optionsmethod onAbstractNodeto retrieve the set of option names (#3051) -
Pass
:input_mtimeoption toDocumentconstructor; letDocumentconstructor assign docdate/time/year attributes (#3029) -
Never mutate strings; add a
frozen_string_literal: truemagic comment to top of all Ruby source files (#3054) -
Always use
docdateanddoctimeto computedocyearanddocdatetime(#3064) -
Rename
PreprocessorReader#exceeded_max_depth?toPreprocessorReader#exceeds_max_depth?and returnnilif includes are disabled -
Stop populating
:idstable in document catalog (#3084) -
Always use
:refstable 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
:bibrefnode (#3085) -
Call
AbstractNode#reftextinstead ofAbstractNode#textto retrieve reference text forbibrefnode (#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_celland:table_column, respectively -
Rename
hardbreaksdocument attribute tohardbreaks-option; retainhardbreaksas 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_attrsto:positional_attrs -
Mark
default_attrsextension DSL method deprecated in favor ofdefault_attributes -
Upgrade MathJax to 2.7.5
Bug fixes
-
Fix crash caused by inline passthrough macro with the macros
subclearing the remaining passthrough placeholders (#3089) -
Fix crash if
ifevaldirective is missing expression (#3164) -
Prevent relative
leveloffsetfrom 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
doctitlevalue when assigning it back to thedoctitledocument attribute (#3106) -
Don’t fail if value of
pygments-styleattribute 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
linenumsenabled 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-commentattribute 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
-aCLI option is empty string or equals sign (#2997) -
Allow failure level of CLI to be set to
info -
Reader#push_includeshould 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=0rather thandepth=1disables nested includes) -
Allow
outfilesuffixto 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
WARNwhen instantiating theNullLogger -
next_adjacent_blockshould 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_EPOCHenv 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