asciidoctor 2.0.18 → 2.0.20

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c415cde38b385b114b0de056cfc4235c6fbfdc0a0b189a7479c477ec4265e72a
4
- data.tar.gz: cf171969c86a19aa9e846751564baf362e1d9fd2ab927c63f8f017c0f8de039e
3
+ metadata.gz: 95bddd5f820dc0441d3accb7dd49864b1fb9f1807823887d0075e595a2d55094
4
+ data.tar.gz: 1dd21111bda88dde555fe981b30e89684bd0ac0bbe8e329721bbdc7b18ab806d
5
5
  SHA512:
6
- metadata.gz: 4a1e07e2a597d176326d8547cebaf2424e43ba861912502f7e544a2ce74fab3567c9b1f9e87061c6586d7bfa1c1dbde764b7c50b7a3746f7b8548426f165c9f5
7
- data.tar.gz: fb5b41022b045dd1ad09f09b5ffd98a512958186388ea1182d96c32367723925718ba49abe7dbaea84bf0c051a3121302a33bf0e302f5d1f25ca3068ba210be4
6
+ metadata.gz: a03b03f8a1bda4d71235f975603353c9653c1ad98ff26a42b5d2d844dab6954c41d75c45d598a8b976bba3b4b35aa05f7e2791c1dc6c1da75714bced767f6f8f
7
+ data.tar.gz: c463c0c23a75ddadf2c1eff1cc3afdf574b07a2551693b7330a1cebcef8a9e789ffa5f9bec005843a327837d33f42298f30684f6d16a8c0271d1379ac080485e
data/CHANGELOG.adoc CHANGED
@@ -1,21 +1,76 @@
1
1
  = Asciidoctor Changelog
2
- :uri-asciidoctor: https://asciidoctor.org
3
- :uri-asciidoc: {uri-asciidoctor}/docs/what-is-asciidoc
4
- :uri-repo: https://github.com/asciidoctor/asciidoctor
2
+ :url-asciidoctor: https://asciidoctor.org
3
+ :url-asciidoc: https://docs.asciidoctor.org/asciidoc/latest/
4
+ :url-repo: https://github.com/asciidoctor/asciidoctor
5
5
  :icons: font
6
6
  :star: icon:star[role=red]
7
7
  ifndef::icons[]
8
8
  :star: ★
9
9
  endif::[]
10
10
 
11
- {uri-asciidoctor}[Asciidoctor] is a _fast_, open source text processor and publishing toolchain for converting {uri-asciidoc}[AsciiDoc] content into HTML 5, DocBook 5, and other formats.
11
+ {url-asciidoctor}[Asciidoctor] is a _fast_, open source text processor and publishing toolchain for converting {url-asciidoc}[AsciiDoc] content into HTML 5, DocBook 5, and other formats.
12
12
 
13
13
  This document provides a high-level view of the changes introduced in Asciidoctor by release.
14
- For an even more detailed look at what has changed, refer to the {uri-repo}/commits/[commit history] on GitHub.
14
+ For an even more detailed look at what has changed, refer to the {url-repo}/commits/[commit history] on GitHub.
15
15
 
16
16
  This project utilizes semantic versioning.
17
17
 
18
18
  // tag::compact[]
19
+ == 2.0.20 (2023-05-18) - @mojavelinux
20
+
21
+ Bug Fixes::
22
+
23
+ * Update `release-version` attribute in READMEs and man page during release
24
+ * Rebuild man page during release
25
+
26
+ === Details
27
+
28
+ {url-repo}/releases/tag/v2.0.20[git tag] | {url-repo}/compare/v2.0.19\...v2.0.20[full diff]
29
+ // end::compact[]
30
+
31
+ == 2.0.19 (2023-05-17) - @mojavelinux
32
+
33
+ Improvements::
34
+
35
+ * Return empty string instead of nil if raw or verbatim block has no lines
36
+ * Don't uppercase monospace span in section title in manpage output (#4402)
37
+ * Simplify processing of implicit link (i.e., autolink) by separating implicit and explicit match
38
+ * Generate partintro block consistently (#4450)
39
+ * Add Kiswahili translation for built-in labels (PR #4454) (*@bkmgit*)
40
+
41
+ Compliance::
42
+
43
+ * Fix call order so use of an include file with invalid encoding continues to raise error when using Ruby >= 3.2.0
44
+ * Fix test assertion for fallback Rouge stylesheet to be compatible with Rouge 4.1 (#4406) (*@tmzullinger*)
45
+ * Support `notitle` option on section as alternative to `untitled` to hide title (#4437)
46
+ * Add support for Haml 6 to template converter (#4429)
47
+
48
+ Bug Fixes::
49
+
50
+ * Process constrained inline passthrough inside monospace span (#4458)
51
+ * Catalog inline ref defined using anchor macro even when resolved reftext is empty
52
+ * Use while loop rather than recursion to locate next line to process; prevents stack limit error (#4368)
53
+ * Avoid matching numeric character references when searching for # in xref target (#4393)
54
+ * Use correct selector to collapse margin on first and last child of sidebar
55
+ * Don't allow target of include directive to start with a space (to distinguish it from a dlist item) or to end with a space
56
+ * Manify alt text of block image in manpage output (#4401)
57
+ * Adjust font size of term in horizontal dlist to match font size of term in regular dlist
58
+ * Implicitly attach nested list that starts with block attribute lines to dlist entry (#4268)
59
+ * Don't swallow square brackets when processing escaped URL macro
60
+ * Treat `uri:classloader:` as an absolute path prefix when running on JRuby (#3929)
61
+ * Apply reftext substitutions to value of `mantitle` attribute in DocBook output (#4448)
62
+ * Enclose `<reftext>` tag in `<article>` tag in DocBook output for man page (#4452)
63
+ * Correctly handle compat role on monospace and constrained passthrough when box attrlist or formatted text is escaped
64
+
65
+ Build / Infrastructure::
66
+
67
+ * Update latest CRuby in CI workflow to 3.2
68
+ * Update latest JRuby in CI workflow to 9.4.2.0
69
+
70
+ === Details
71
+
72
+ {url-repo}/releases/tag/v2.0.19[git tag] | {url-repo}/compare/v2.0.18\...v2.0.19[full diff]
73
+
19
74
  == 2.0.18 (2022-10-15) - @mojavelinux
20
75
 
21
76
  Improvements::
@@ -38,8 +93,7 @@ Bug Fixes::
38
93
 
39
94
  === Details
40
95
 
41
- {url-repo}/releases/tag/v2.0.18[git tag] | {url-repo}/compare/v2.0.17\...v2.0.18[source diff]
42
- // end::compact[]
96
+ {url-repo}/releases/tag/v2.0.18[git tag] | {url-repo}/compare/v2.0.17\...v2.0.18[full diff]
43
97
 
44
98
  == 2.0.17 (2022-01-05) - @mojavelinux
45
99
 
data/README-de.adoc CHANGED
@@ -1,5 +1,6 @@
1
1
  = Asciidoctor
2
2
  Dan Allen <https://github.com/mojavelinux[@mojavelinux]>; Sarah White <https://github.com/graphitefriction[@graphitefriction]>
3
+ v2.0.20, 2023-05-18
3
4
  // settings:
4
5
  :idprefix:
5
6
  :idseparator: -
@@ -15,7 +16,7 @@ ifdef::env-github[]
15
16
  :warning-caption: :warning:
16
17
  endif::[]
17
18
  // Variables:
18
- :release-version: 2.0.17
19
+ :release-version: 2.0.20
19
20
  // URIs:
20
21
  :uri-org: https://github.com/asciidoctor
21
22
  :uri-repo: {uri-org}/asciidoctor
data/README-fr.adoc CHANGED
@@ -1,5 +1,6 @@
1
1
  = Asciidoctor
2
2
  Dan Allen <https://github.com/mojavelinux[@mojavelinux]>; Sarah White <https://github.com/graphitefriction[@graphitefriction]>
3
+ v2.0.20, 2023-05-18
3
4
  // settings:
4
5
  :idprefix:
5
6
  :idseparator: -
@@ -15,7 +16,7 @@ ifdef::env-github[]
15
16
  :warning-caption: :warning:
16
17
  endif::[]
17
18
  // Variables:
18
- :release-version: 2.0.17
19
+ :release-version: 2.0.20
19
20
  // URIs:
20
21
  :uri-org: https://github.com/asciidoctor
21
22
  :uri-repo: {uri-org}/asciidoctor
data/README-jp.adoc CHANGED
@@ -1,5 +1,6 @@
1
1
  = Asciidoctor
2
2
  Dan Allen <https://github.com/mojavelinux[@mojavelinux]>; Sarah White <https://github.com/graphitefriction[@graphitefriction]>
3
+ v2.0.20, 2023-05-18
3
4
  // settings:
4
5
  :idprefix:
5
6
  :idseparator: -
@@ -15,7 +16,7 @@ ifdef::env-github[]
15
16
  :warning-caption: :warning:
16
17
  endif::[]
17
18
  // Variables:
18
- :release-version: 2.0.17
19
+ :release-version: 2.0.20
19
20
  // URIs:
20
21
  :uri-org: https://github.com/asciidoctor
21
22
  :uri-repo: {uri-org}/asciidoctor
data/README-zh_CN.adoc CHANGED
@@ -1,5 +1,6 @@
1
1
  = Asciidoctor
2
2
  Dan Allen <https://github.com/mojavelinux[@mojavelinux]>; Sarah White <https://github.com/graphitefriction[@graphitefriction]>
3
+ v2.0.20, 2023-05-18
3
4
  // settings:
4
5
  :page-layout: base
5
6
  :idprefix:
@@ -16,7 +17,7 @@ ifdef::env-github[]
16
17
  :warning-caption: :warning:
17
18
  endif::[]
18
19
  // Variables:
19
- :release-version: 2.0.17
20
+ :release-version: 2.0.20
20
21
  // URIs:
21
22
  :uri-org: https://github.com/asciidoctor
22
23
  :uri-repo: {uri-org}/asciidoctor
data/README.adoc CHANGED
@@ -1,6 +1,6 @@
1
1
  = Asciidoctor
2
2
  Dan Allen <https://github.com/mojavelinux[@mojavelinux]>; Sarah White <https://github.com/graphitefriction[@graphitefriction]>
3
- v2.0.18, 2022-10-15
3
+ v2.0.20, 2023-05-18
4
4
  // settings:
5
5
  :idprefix:
6
6
  :idseparator: -
@@ -16,7 +16,7 @@ ifdef::env-github[]
16
16
  :warning-caption: :warning:
17
17
  endif::[]
18
18
  // Variables:
19
- :release-version: 2.0.17
19
+ :release-version: 2.0.20
20
20
  // URLs:
21
21
  :url-org: https://github.com/asciidoctor
22
22
  :url-repo: {url-org}/asciidoctor
@@ -130,20 +130,22 @@ If you're using AsciiDoc.py, see {url-docs}/asciidoctor/latest/migrate/asciidoc-
130
130
 
131
131
  Asciidoctor works on Linux, macOS and Windows and requires one of the following implementations of {url-ruby}[Ruby]:
132
132
 
133
- * CRuby (aka MRI) 2.3 - 3.0
134
- * JRuby 9.1 - 9.2
133
+ * CRuby (aka MRI) 2.3 - 3.2
134
+ * JRuby 9.1 - 9.4
135
135
  * TruffleRuby (GraalVM)
136
136
 
137
137
  [CAUTION]
138
138
  ====
139
139
  If you're using a non-English Windows environment, you may bump into an `Encoding::UndefinedConversionError` when invoking Asciidoctor.
140
- To solve this issue, we recommend changing the active code page in your console to UTF-8:
140
+ To solve this issue, we recommend overriding the default external and internal character encodings to `utf-8`.
141
+ You can do so by setting the `RUBYOPT` environment variable as follows:
141
142
 
142
- chcp 65001
143
+ RUBYOPT="-E utf-8:utf-8"
144
+
145
+ Once you make this change, all your Unicode headaches should be behind you.
143
146
 
144
- Once you make this change, all your Unicode headaches will be behind you.
145
147
  If you're using an IDE like Eclipse, make sure you set the encoding to UTF-8 there as well.
146
- Asciidoctor works best when you use UTF-8 everywhere.
148
+ Asciidoctor is optimized to work with UTF-8 as the default encoding.
147
149
  ====
148
150
 
149
151
  == Installation
data/asciidoctor.gemspec CHANGED
@@ -38,9 +38,9 @@ Gem::Specification.new do |s|
38
38
  s.add_development_dependency 'cucumber', '~> 3.1.0'
39
39
  # erubi is needed for testing alternate eRuby impls
40
40
  s.add_development_dependency 'erubi', '~> 1.10.0'
41
- s.add_development_dependency 'haml', '~> 5.2.0'
41
+ s.add_development_dependency 'haml', '~> 6.1.0'
42
42
  s.add_development_dependency 'minitest', '~> 5.14.0'
43
- s.add_development_dependency 'nokogiri', '~> 1.10.0'
43
+ s.add_development_dependency 'nokogiri', '~> 1.13.0'
44
44
  s.add_development_dependency 'rake', '~> 12.3.0'
45
45
  s.add_development_dependency 'slim', '~> 4.1.0'
46
46
  s.add_development_dependency 'tilt', '~> 2.0.0'
@@ -0,0 +1,23 @@
1
+ // Kiswahili translation, Benson Muite
2
+ :appendix-caption: Kiambatisho
3
+ :appendix-refsig: {appendix-caption}
4
+ :caution-caption: Hatari
5
+ :chapter-signifier: Somo
6
+ :chapter-refsig: {chapter-signifier}
7
+ :example-caption: Mfano
8
+ :figure-caption: Picha
9
+ :important-caption: Muhimu
10
+ :last-update-label: Geuza la mwisho
11
+ ifdef::listing-caption[:listing-caption: Orodha]
12
+ ifdef::manname-title[:manname-title: Jina]
13
+ :note-caption: Muhtasari
14
+ :part-signifier: Sehemu
15
+ :part-refsig: {part-signifier}
16
+ ifdef::preface-title[:preface-title: Dibaji]
17
+ :section-refsig: Fungu
18
+ :table-caption: Ratiba
19
+ :tip-caption: Shauri
20
+ :toc-title: Fahirisi
21
+ :untitled-label: Bila kichwa
22
+ :version-label: Toleo
23
+ :warning-caption: Onyo
@@ -198,13 +198,10 @@ table.tableblock.fit-content>caption.title{white-space:nowrap;width:0}
198
198
  .admonitionblock>table td.content{padding-left:1.125em;padding-right:1.25em;border-left:1px solid #dddddf;color:rgba(0,0,0,.6);word-wrap:anywhere}
199
199
  .admonitionblock>table td.content>:last-child>:last-child{margin-bottom:0}
200
200
  .exampleblock>.content{border:1px solid #e6e6e6;margin-bottom:1.25em;padding:1.25em;background:#fff;border-radius:4px}
201
- .exampleblock>.content>:first-child{margin-top:0}
202
- .exampleblock>.content>:last-child{margin-bottom:0}
203
201
  .sidebarblock{border:1px solid #dbdbd6;margin-bottom:1.25em;padding:1.25em;background:#f3f3f2;border-radius:4px}
204
- .sidebarblock>:first-child{margin-top:0}
205
- .sidebarblock>:last-child{margin-bottom:0}
206
202
  .sidebarblock>.content>.title{color:#7a2518;margin-top:0;text-align:center}
207
- .exampleblock>.content>:last-child>:last-child,.exampleblock>.content .olist>ol>li:last-child>:last-child,.exampleblock>.content .ulist>ul>li:last-child>:last-child,.exampleblock>.content .qlist>ol>li:last-child>:last-child,.sidebarblock>.content>:last-child>:last-child,.sidebarblock>.content .olist>ol>li:last-child>:last-child,.sidebarblock>.content .ulist>ul>li:last-child>:last-child,.sidebarblock>.content .qlist>ol>li:last-child>:last-child{margin-bottom:0}
203
+ .exampleblock>.content>:first-child,.sidebarblock>.content>:first-child{margin-top:0}
204
+ .exampleblock>.content>:last-child,.exampleblock>.content>:last-child>:last-child,.exampleblock>.content .olist>ol>li:last-child>:last-child,.exampleblock>.content .ulist>ul>li:last-child>:last-child,.exampleblock>.content .qlist>ol>li:last-child>:last-child,.sidebarblock>.content>:last-child,.sidebarblock>.content>:last-child>:last-child,.sidebarblock>.content .olist>ol>li:last-child>:last-child,.sidebarblock>.content .ulist>ul>li:last-child>:last-child,.sidebarblock>.content .qlist>ol>li:last-child>:last-child{margin-bottom:0}
208
205
  .literalblock pre,.listingblock>.content>pre{border-radius:4px;overflow-x:auto;padding:1em;font-size:.8125em}
209
206
  @media screen and (min-width:768px){.literalblock pre,.listingblock>.content>pre{font-size:.90625em}}
210
207
  @media screen and (min-width:1280px){.literalblock pre,.listingblock>.content>pre{font-size:1em}}
@@ -383,7 +380,7 @@ b.conum *{color:inherit!important}
383
380
  dt,th.tableblock,td.content,div.footnote{text-rendering:optimizeLegibility}
384
381
  h1,h2,p,td.content,span.alt,summary{letter-spacing:-.01em}
385
382
  p strong,td.content strong,div.footnote strong{letter-spacing:-.005em}
386
- p,blockquote,dt,td.content,span.alt,summary{font-size:1.0625rem}
383
+ p,blockquote,dt,td.content,td.hdlist1,span.alt,summary{font-size:1.0625rem}
387
384
  p{margin-bottom:1.25rem}
388
385
  .sidebarblock p,.sidebarblock dt,.sidebarblock td.content,p.tableblock{font-size:1em}
389
386
  .exampleblock>.content{background:#fffef7;border-color:#e0e0dc;box-shadow:0 1px 4px #e0e0dc}
@@ -24,6 +24,7 @@ class AbstractBlock < AbstractNode
24
24
  attr_accessor :numeral
25
25
 
26
26
  # Public: Gets/Sets the location in the AsciiDoc source where this block begins.
27
+ # Tracking source location is not enabled by default, and is controlled by the sourcemap option.
27
28
  attr_accessor :source_location
28
29
 
29
30
  # Public: Get/Set the String style (block type qualifier) for this block.
@@ -116,7 +116,7 @@ class Block < AbstractBlock
116
116
  # maybe apply_subs can know how to strip whitespace?
117
117
  result = apply_subs @lines, @subs
118
118
  if result.size < 2
119
- result[0]
119
+ result[0] || ''
120
120
  else
121
121
  result.shift while (first = result[0]) && first.rstrip.empty?
122
122
  result.pop while (last = result[-1]) && last.rstrip.empty?
@@ -39,11 +39,25 @@ class Converter::DocBook5Converter < Converter::Base
39
39
  result << ((node.attr? 'sectnumlevels') ? %(<?asciidoc-numbered maxdepth="#{node.attr 'sectnumlevels'}"?>) : '<?asciidoc-numbered?>') if node.attr? 'sectnums'
40
40
  lang_attribute = (node.attr? 'nolang') ? '' : %( xml:lang="#{node.attr 'lang', 'en'}")
41
41
  if (root_tag_name = node.doctype) == 'manpage'
42
- root_tag_name = 'refentry'
42
+ manpage = true
43
+ root_tag_name = 'article'
43
44
  end
44
45
  root_tag_idx = result.size
45
46
  id = node.id
46
47
  result << (document_info_tag node) unless node.noheader
48
+ if manpage
49
+ result << '<refentry>'
50
+ result << '<refmeta>'
51
+ result << %(<refentrytitle>#{node.apply_reftext_subs node.attr 'mantitle'}</refentrytitle>) if node.attr? 'mantitle'
52
+ result << %(<manvolnum>#{node.attr 'manvolnum'}</manvolnum>) if node.attr? 'manvolnum'
53
+ result << %(<refmiscinfo class="source">#{node.attr 'mansource', '&#160;'}</refmiscinfo>)
54
+ result << %(<refmiscinfo class="manual">#{node.attr 'manmanual', '&#160;'}</refmiscinfo>)
55
+ result << '</refmeta>'
56
+ result << '<refnamediv>'
57
+ result += (node.attr 'mannames').map {|n| %(<refname>#{n}</refname>) } if node.attr? 'mannames'
58
+ result << %(<refpurpose>#{node.attr 'manpurpose'}</refpurpose>) if node.attr? 'manpurpose'
59
+ result << '</refnamediv>'
60
+ end
47
61
  unless (docinfo_content = node.docinfo :header).empty?
48
62
  result << docinfo_content
49
63
  end
@@ -51,6 +65,7 @@ class Converter::DocBook5Converter < Converter::Base
51
65
  unless (docinfo_content = node.docinfo :footer).empty?
52
66
  result << docinfo_content
53
67
  end
68
+ result << '</refentry>' if manpage
54
69
  id, node.id = node.id, nil unless id
55
70
  # defer adding root tag in case document ID is auto-generated on demand
56
71
  result.insert root_tag_idx, %(<#{root_tag_name} xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0"#{lang_attribute}#{common_attributes id}>)
@@ -66,7 +81,7 @@ class Converter::DocBook5Converter < Converter::Base
66
81
  else
67
82
  tag_name = node.sectname
68
83
  end
69
- title_el = node.special && (node.option? 'untitled') ? '' : %(<title>#{node.title}</title>\n)
84
+ title_el = node.special && ((node.option? 'notitle') || (node.option? 'untitled')) ? '' : %(<title>#{node.title}</title>\n)
70
85
  %(<#{tag_name}#{common_attributes node.id, node.role, node.reftext}>
71
86
  #{title_el}#{node.content}
72
87
  </#{tag_name}>)
@@ -248,10 +263,10 @@ class Converter::DocBook5Converter < Converter::Base
248
263
  def convert_stem node
249
264
  if (idx = node.subs.index :specialcharacters)
250
265
  node.subs.delete_at idx
251
- equation = node.content || ''
266
+ equation = node.content
252
267
  idx > 0 ? (node.subs.insert idx, :specialcharacters) : (node.subs.unshift :specialcharacters)
253
268
  else
254
- equation = node.content || ''
269
+ equation = node.content
255
270
  end
256
271
  if node.style == 'asciimath'
257
272
  # NOTE fop requires jeuclid to process mathml markup
@@ -702,19 +717,6 @@ class Converter::DocBook5Converter < Converter::Base
702
717
  end
703
718
  result << '</info>'
704
719
 
705
- if doc.doctype == 'manpage'
706
- result << '<refmeta>'
707
- result << %(<refentrytitle>#{doc.attr 'mantitle'}</refentrytitle>) if doc.attr? 'mantitle'
708
- result << %(<manvolnum>#{doc.attr 'manvolnum'}</manvolnum>) if doc.attr? 'manvolnum'
709
- result << %(<refmiscinfo class="source">#{doc.attr 'mansource', '&#160;'}</refmiscinfo>)
710
- result << %(<refmiscinfo class="manual">#{doc.attr 'manmanual', '&#160;'}</refmiscinfo>)
711
- result << '</refmeta>'
712
- result << '<refnamediv>'
713
- result += (doc.attr 'mannames').map {|n| %(<refname>#{n}</refname>) } if doc.attr? 'mannames'
714
- result << %(<refpurpose>#{doc.attr 'manpurpose'}</refpurpose>) if doc.attr? 'manpurpose'
715
- result << '</refnamediv>'
716
- end
717
-
718
720
  result.join LF
719
721
  end
720
722
 
@@ -675,7 +675,7 @@ Your browser does not support the audio tag.
675
675
  title_element = node.title? ? %(<div class="title">#{node.captioned_title}</div>\n) : ''
676
676
  %(<div#{id_attribute} class="listingblock#{(role = node.role) ? " #{role}" : ''}">
677
677
  #{title_element}<div class="content">
678
- #{syntax_hl ? (syntax_hl.format node, lang, opts) : pre_open + (node.content || '') + pre_close}
678
+ #{syntax_hl ? (syntax_hl.format node, lang, opts) : pre_open + node.content + pre_close}
679
679
  </div>
680
680
  </div>)
681
681
  end
@@ -28,7 +28,7 @@ class Converter::ManPageConverter < Converter::Base
28
28
  EllipsisCharRefRx = /&#8230;(?:&#8203;)?/
29
29
  WrappedIndentRx = /#{CG_BLANK}*#{LF}#{CG_BLANK}*/
30
30
  XMLMarkupRx = /&#?[a-z\d]+;|</
31
- PCDATAFilterRx = /(&#?[a-z\d]+;|<[^>]+>)|([^&<]+)/
31
+ PCDATAFilterRx = %r((&#?[a-z\d]+;|<#{ESC}\\f\(CR.*?</#{ESC}\\fP>|<[^>]+>)|([^&<]+))
32
32
 
33
33
  def initialize backend, opts = {}
34
34
  @backend = backend
@@ -39,7 +39,7 @@ class Converter::ManPageConverter < Converter::Base
39
39
  unless node.attr? 'mantitle'
40
40
  raise 'asciidoctor: ERROR: doctype must be set to manpage when using manpage backend'
41
41
  end
42
- mantitle = node.attr 'mantitle'
42
+ mantitle = (node.attr 'mantitle').gsub InvalidSectionIdCharsRx, ''
43
43
  manvolnum = node.attr 'manvolnum', '1'
44
44
  manname = node.attr 'manname', mantitle
45
45
  manmanual = node.attr 'manmanual'
@@ -236,7 +236,7 @@ r lw(\n(.lu*75u/100u).'
236
236
  result << (node.title? ? %(.sp
237
237
  .B #{manify node.captioned_title}
238
238
  .br) : '.sp')
239
- result << %([#{node.alt}])
239
+ result << %([#{manify node.alt}])
240
240
  result.join LF
241
241
  end
242
242
 
@@ -29,7 +29,7 @@ class Converter::TemplateConverter < Converter::Base
29
29
  erb: { trim: 0 },
30
30
  # TODO line 466 of haml/compiler.rb sorts the attributes; file an issue to make this configurable
31
31
  # NOTE AsciiDoc syntax expects HTML/XML output to use double quotes around attribute values
32
- haml: { format: :xhtml, attr_wrapper: '"', escape_attrs: false, ugly: true },
32
+ haml: { format: :xhtml, attr_wrapper: '"', escape_html: false, escape_attrs: false, ugly: true },
33
33
  slim: { disable_escape: true, sort_attrs: false, pretty: false },
34
34
  }
35
35
 
@@ -227,6 +227,7 @@ class Converter::TemplateConverter < Converter::Base
227
227
  Helpers.require_library 'haml' unless defined? ::Haml::Engine
228
228
  # NOTE Haml 5 dropped support for pretty printing
229
229
  @engine_options[extsym].delete :ugly if defined? ::Haml::TempleEngine
230
+ @engine_options[extsym][:attr_quote] = @engine_options[extsym].delete :attr_wrapper unless defined? ::Haml::Options
230
231
  @active_engines[extsym] = true
231
232
  end
232
233
  when :erb
@@ -1109,6 +1109,9 @@ module Extensions
1109
1109
  # Public: Checks whether any {BlockProcessor} extensions are registered to
1110
1110
  # handle the specified block name appearing on the specified context.
1111
1111
  #
1112
+ # This method assumes you've called blocks? first to check whether any
1113
+ # block extensions are registered.
1114
+ #
1112
1115
  # Returns the [Extension] proxy object for the BlockProcessor that matches
1113
1116
  # the block name and context or false if no match is found.
1114
1117
  def registered_for_block? name, context
@@ -1124,6 +1127,9 @@ module Extensions
1124
1127
  #
1125
1128
  # name - the String or Symbol (coersed to a Symbol) macro name
1126
1129
  #
1130
+ # This method assumes you've called blocks? first to check whether any
1131
+ # block extensions are registered.
1132
+ #
1127
1133
  # Returns the [Extension] object stored in the registry that proxies the
1128
1134
  # corresponding BlockProcessor or nil if a match is not found.
1129
1135
  def find_block_extension name
@@ -1200,6 +1206,9 @@ module Extensions
1200
1206
  #
1201
1207
  # name - the String or Symbol (coersed to a Symbol) macro name
1202
1208
  #
1209
+ # This method assumes you've called block_macros? first to check whether any
1210
+ # block macro extensions are registered.
1211
+ #
1203
1212
  # Returns the [Extension] proxy object for the BlockMacroProcessor that matches
1204
1213
  # the macro name or false if no match is found.
1205
1214
  #--
@@ -1213,6 +1222,9 @@ module Extensions
1213
1222
  #
1214
1223
  # name - the String or Symbol (coersed to a Symbol) macro name
1215
1224
  #
1225
+ # This method assumes you've called block_macros? first to check whether any
1226
+ # block macro extensions are registered.
1227
+ #
1216
1228
  # Returns the [Extension] object stored in the registry that proxies the
1217
1229
  # corresponding BlockMacroProcessor or nil if a match is not found.
1218
1230
  def find_block_macro_extension name
@@ -1289,6 +1301,9 @@ module Extensions
1289
1301
  #
1290
1302
  # name - the String or Symbol (coersed to a Symbol) macro name
1291
1303
  #
1304
+ # This method assumes you've called inline_macros? first to check whether any
1305
+ # inline macro extensions are registered.
1306
+ #
1292
1307
  # Returns the [Extension] proxy object for the InlineMacroProcessor that matches
1293
1308
  # the macro name or false if no match is found.
1294
1309
  def registered_for_inline_macro? name
@@ -1300,6 +1315,9 @@ module Extensions
1300
1315
  #
1301
1316
  # name - the String or Symbol (coersed to a Symbol) macro name
1302
1317
  #
1318
+ # This method assumes you've called inline_macros? first to check whether any
1319
+ # inline macro extensions are registered.
1320
+ #
1303
1321
  # Returns the [Extension] object stored in the registry that proxies the
1304
1322
  # corresponding InlineMacroProcessor or nil if a match is not found.
1305
1323
  def find_inline_macro_extension name
@@ -1309,6 +1327,9 @@ module Extensions
1309
1327
  # Public: Retrieves the {Extension} proxy objects for all
1310
1328
  # InlineMacroProcessor instances in this registry.
1311
1329
  #
1330
+ # This method assumes you've called inline_macros? first to check whether any
1331
+ # inline macro extensions are registered.
1332
+ #
1312
1333
  # Returns an [Array] of Extension proxy objects.
1313
1334
  def inline_macros
1314
1335
  @inline_macro_extensions.values
@@ -120,8 +120,14 @@ module Helpers
120
120
  # str - the String to check
121
121
  #
122
122
  # returns true if the String is a URI, false if it is not
123
- def uriish? str
124
- (str.include? ':') && (UriSniffRx.match? str)
123
+ if ::RUBY_ENGINE == 'jruby'
124
+ def uriish? str
125
+ (str.include? ':') && !(str.start_with? 'uri:classloader:') && (UriSniffRx.match? str)
126
+ end
127
+ else
128
+ def uriish? str
129
+ (str.include? ':') && (UriSniffRx.match? str)
130
+ end
125
131
  end
126
132
 
127
133
  # Internal: Encode a URI component String for safe inclusion in a URI.
@@ -398,18 +398,22 @@ class Parser
398
398
  # REVIEW this may be doing too much
399
399
  if part
400
400
  if !section.blocks?
401
- # if this block wasn't marked as [partintro], emulate behavior as if it had
401
+ # if this not a [partintro] open block, enclose it in a [partintro] open block
402
402
  if new_block.style != 'partintro'
403
- # emulate [partintro] paragraph
404
- if new_block.context == :paragraph
405
- new_block.context = :open
403
+ # if this is already a normal open block, simply add the partintro style
404
+ if new_block.style == 'open' && new_block.context == :open
406
405
  new_block.style = 'partintro'
407
- # emulate [partintro] open block
408
406
  else
409
407
  new_block.parent = (intro = Block.new section, :open, content_model: :compound)
410
408
  intro.style = 'partintro'
411
409
  section.blocks << intro
412
410
  end
411
+ # if this is a [partintro] paragraph, convert it to a [partintro] open block w/ single paragraph
412
+ elsif new_block.content_model == :simple
413
+ new_block.content_model = :compound
414
+ new_block << (Block.new new_block, :paragraph, source: new_block.lines, subs: new_block.subs)
415
+ new_block.lines.clear
416
+ new_block.subs.clear
413
417
  end
414
418
  elsif section.blocks.size == 1
415
419
  first_block = section.blocks[0]
@@ -419,12 +423,11 @@ class Parser
419
423
  # rebuild [partintro] paragraph as an open block
420
424
  elsif first_block.content_model != :compound
421
425
  new_block.parent = (intro = Block.new section, :open, content_model: :compound)
422
- intro.style = 'partintro'
423
- section.blocks.shift
424
- if first_block.style == 'partintro'
426
+ if first_block.style == (intro.style = 'partintro')
425
427
  first_block.context = :paragraph
426
428
  first_block.style = nil
427
429
  end
430
+ section.blocks.shift
428
431
  intro << first_block
429
432
  section.blocks << intro
430
433
  end
@@ -1168,8 +1171,8 @@ class Parser
1168
1171
  if reftext.include? ']'
1169
1172
  reftext = reftext.gsub '\]', ']'
1170
1173
  reftext = document.sub_attributes reftext if reftext.include? ATTR_REF_HEAD
1171
- elsif (reftext.include? ATTR_REF_HEAD) && (reftext = document.sub_attributes reftext).empty?
1172
- next
1174
+ elsif reftext.include? ATTR_REF_HEAD
1175
+ reftext = nil if (reftext = document.sub_attributes reftext).empty?
1173
1176
  end
1174
1177
  end
1175
1178
  end
@@ -1439,21 +1442,33 @@ class Parser
1439
1442
 
1440
1443
  # a delimited block immediately breaks the list unless preceded
1441
1444
  # by a list continuation (they are harsh like that ;0)
1442
- if (match = is_delimited_block?(this_line, true))
1443
- if continuation == :active
1444
- buffer << this_line
1445
- # grab all the lines in the block, leaving the delimiters in place
1446
- # we're being more strict here about the terminator, but I think that's a good thing
1447
- buffer.concat reader.read_lines_until(terminator: match.terminator, read_last_line: true, context: nil)
1448
- continuation = :inactive
1449
- else
1445
+ if (match = is_delimited_block? this_line, true)
1446
+ break unless continuation == :active
1447
+ buffer << this_line
1448
+ # grab all the lines in the block, leaving the delimiters in place
1449
+ # we're being more strict here about the terminator, but I think that's a good thing
1450
+ buffer.concat reader.read_lines_until terminator: match.terminator, read_last_line: true, context: nil
1451
+ continuation = :inactive
1452
+ # BlockAttributeLineRx only breaks dlist if ensuing line is not a list item
1453
+ elsif dlist && continuation != :active && (this_line.start_with? '[') && (BlockAttributeLineRx.match? this_line)
1454
+ block_attribute_lines = [this_line]
1455
+ while (next_line = reader.peek_line)
1456
+ if is_delimited_block? next_line
1457
+ interrupt = true
1458
+ elsif next_line.empty? || ((next_line.start_with? '[') && (BlockAttributeLineRx.match? next_line))
1459
+ block_attribute_lines << reader.read_line
1460
+ next
1461
+ elsif (AnyListRx.match? next_line) && !(is_sibling_list_item? next_line, list_type, sibling_trait)
1462
+ buffer.concat block_attribute_lines
1463
+ else # rubocop:disable Lint/DuplicateBranch
1464
+ interrupt = true
1465
+ end
1466
+ break
1467
+ end
1468
+ if interrupt
1469
+ reader.unshift_lines block_attribute_lines
1450
1470
  break
1451
1471
  end
1452
- # technically BlockAttributeLineRx only breaks if ensuing line is not a list item
1453
- # which really means BlockAttributeLineRx only breaks if it's acting as a block delimiter
1454
- # FIXME to be AsciiDoc compliant, we shouldn't break if style in attribute line is "literal" (i.e., [literal])
1455
- elsif dlist && continuation != :active && (BlockAttributeLineRx.match? this_line)
1456
- break
1457
1472
  elsif continuation == :active && !this_line.empty?
1458
1473
  # literal paragraphs have special considerations (and this is one of
1459
1474
  # two entry points into one)
@@ -1470,7 +1485,8 @@ class Parser
1470
1485
  end
1471
1486
  continuation = :inactive
1472
1487
  # let block metadata play out until we find the block
1473
- elsif (BlockTitleRx.match? this_line) || (BlockAttributeLineRx.match? this_line) || (AttributeEntryRx.match? this_line)
1488
+ elsif ((ch0 = this_line.chr) == '.' && (BlockTitleRx.match? this_line)) ||
1489
+ (ch0 == '[' && (BlockAttributeLineRx.match? this_line)) || (ch0 == ':' && (AttributeEntryRx.match? this_line))
1474
1490
  buffer << this_line
1475
1491
  else
1476
1492
  if (nested_list_type = (within_nested_list ? [:dlist] : NESTABLE_LIST_CONTEXTS).find {|ctx| ListRxMap[ctx].match? this_line })
@@ -109,6 +109,7 @@ class PathResolver
109
109
  SLASH = '/'
110
110
  BACKSLASH = '\\'
111
111
  DOUBLE_SLASH = '//'
112
+ URI_CLASSLOADER = 'uri:classloader:'
112
113
  WindowsRootRx = %r(^(?:[a-zA-Z]:)?[\\/])
113
114
 
114
115
  attr_accessor :file_separator
@@ -148,8 +149,9 @@ class PathResolver
148
149
  # Public: Check if the specified path is an absolute root path (or, in the
149
150
  # browser environment, an absolute URI as well)
150
151
  #
151
- # This operation considers both posix paths and Windows paths. If the JavaScript IO
152
- # module is xmlhttprequest, this operation also considers absolute URIs.
152
+ # This operation considers both POSIX and Windows paths. If the JavaScript IO module
153
+ # is xmlhttprequest, this operation also considers absolute URIs. If running on JRuby,
154
+ # this operation also considers classloader URIs (starts with uri:classloader:).
153
155
  #
154
156
  # Unix absolute paths and UNC paths start with slash. Windows roots can
155
157
  # start with a drive letter. When the IO module is xmlhttprequest (Opal
@@ -164,6 +166,10 @@ class PathResolver
164
166
  def root? path
165
167
  (absolute_path? path) || (path.start_with? 'file://', 'http://', 'https://')
166
168
  end
169
+ elsif ::RUBY_ENGINE == 'jruby'
170
+ def root? path
171
+ (absolute_path? path) || (path.start_with? URI_CLASSLOADER)
172
+ end
167
173
  else
168
174
  alias root? absolute_path?
169
175
  end
@@ -299,6 +305,9 @@ class PathResolver
299
305
  # ex. /sample/path
300
306
  elsif posix_path.start_with? SLASH
301
307
  root = SLASH
308
+ # ex. uri:classloader:sample/path (or uri:classloader:/sample/path)
309
+ elsif posix_path.start_with? URI_CLASSLOADER
310
+ root = posix_path.slice 0, URI_CLASSLOADER.length
302
311
  # ex. C:/sample/path (or file:///sample/path in browser environment)
303
312
  else
304
313
  root = posix_path.slice 0, (posix_path.index SLASH) + 1
@@ -125,16 +125,21 @@ class Reader
125
125
  # Returns the next line of the source data as a String if there are lines remaining.
126
126
  # Returns nothing if there is no more data.
127
127
  def peek_line direct = false
128
- if direct || @look_ahead > 0
129
- @unescape_next_line ? ((line = @lines[-1]).slice 1, line.length) : @lines[-1]
130
- elsif @lines.empty?
131
- @look_ahead = 0
132
- nil
133
- else
134
- # FIXME the problem with this approach is that we aren't
135
- # retaining the modified line (hence the @unescape_next_line tweak)
136
- # perhaps we need a stack of proxied lines
137
- (process_line @lines[-1]) || peek_line
128
+ while true
129
+ next_line = @lines[-1]
130
+ if direct || @look_ahead > 0
131
+ return @unescape_next_line ? (next_line.slice 1, next_line.length) : next_line
132
+ elsif next_line
133
+ # FIXME the problem with this approach is that we aren't
134
+ # retaining the modified line (hence the @unescape_next_line tweak)
135
+ # perhaps we need a stack of proxied lines
136
+ if (line = process_line next_line)
137
+ return line
138
+ end
139
+ else
140
+ @look_ahead = 0
141
+ return
142
+ end
138
143
  end
139
144
  end
140
145
 
@@ -1197,15 +1202,16 @@ class PreprocessorReader < Reader
1197
1202
  push_include inc_lines, inc_path, relpath, inc_offset, parsed_attrs
1198
1203
  end
1199
1204
  else
1205
+ inc_content = nil
1200
1206
  begin
1201
1207
  # NOTE read content before shift so cursor is only advanced if IO operation succeeds
1202
1208
  inc_content = reader.call(inc_path, read_mode) {|f| f.read }
1203
1209
  shift
1204
- push_include inc_content, inc_path, relpath, 1, parsed_attrs
1205
1210
  rescue
1206
1211
  logger.error message_with_context %(include #{target_type} not readable: #{inc_path}), source_location: cursor
1207
1212
  return replace_next_line %(Unresolved directive in #{@path} - include::#{expanded_target}[#{attrlist}])
1208
1213
  end
1214
+ push_include inc_content, inc_path, relpath, 1, parsed_attrs
1209
1215
  end
1210
1216
  true
1211
1217
  end
@@ -89,7 +89,7 @@ module Asciidoctor
89
89
  # include::chapter1.ad[]
90
90
  # include::example.txt[lines=1;2;5..10]
91
91
  #
92
- IncludeDirectiveRx = /^(\\)?include::([^\[][^\[]*)\[(#{CC_ANY}+)?\]$/
92
+ IncludeDirectiveRx = /^(\\)?include::([^\s\[](?:[^\[]*[^\s\[])?)\[(#{CC_ANY}+)?\]$/
93
93
 
94
94
  # Matches a trailing tag directive in an include file.
95
95
  #
@@ -516,9 +516,9 @@ module Asciidoctor
516
516
  # <https://github.com>
517
517
  # link:https://github.com[]
518
518
  # "https://github.com[]"
519
+ # (https://github.com) <= parenthesis not included in autolink
519
520
  #
520
- # FIXME revisit! the main issue is we need different rules for implicit vs explicit
521
- InlineLinkRx = %r((^|link:|#{CG_BLANK}|&lt;|[>\(\)\[\];"'])(\\?(?:https?|file|ftp|irc)://[^\s\[\]<]*([^\s.,\[\]<]))(?:\[(|#{CC_ALL}*?[^\\])\])?)m
521
+ InlineLinkRx = %r((^|link:|#{CG_BLANK}|&lt;|[>\(\)\[\];"'])(\\?(?:https?|file|ftp|irc)://)(?:([^\s\[\]]+)\[(|#{CC_ALL}*?[^\\])\]|([^\s\[\]<]*([^\s,.?!\[\]<\)]))))m
522
522
 
523
523
  # Match a link or e-mail inline macro.
524
524
  #
@@ -568,23 +568,17 @@ module Asciidoctor
568
568
  # Examples
569
569
  #
570
570
  # +text+
571
- # `text` (compat)
571
+ # [x-]+text+
572
+ # [x-]`text`
573
+ # `text` (compat only)
574
+ # [role]`text` (compat only)
572
575
  #
573
576
  # NOTE we always capture the attributes so we know when to use compatible (i.e., legacy) behavior
574
577
  InlinePassRx = {
575
- false => ['+', '`', /(^|[^#{CC_WORD};:])(?:\[([^\]]+)\])?(\\?(\+|`)(\S|\S#{CC_ALL}*?\S)\4)(?!#{CG_WORD})/m],
576
- true => ['`', nil, /(^|[^`#{CC_WORD}])(?:\[([^\]]+)\])?(\\?(`)([^`\s]|[^`\s]#{CC_ALL}*?\S)\4)(?![`#{CC_WORD}])/m]
578
+ false => ['+', '-]', /((?:^|[^#{CC_WORD};:\\])(?=(\[)|\+)|\\(?=\[)|(?=\\\+))(?:\2(x-|[^\]]+ x-)\]|(?:\[([^\]]+)\])?(?=(\\)?\+))(\5?(\+|`)(\S|\S#{CC_ALL}*?\S)\7)(?!#{CG_WORD})/m],
579
+ true => ['`', nil, /(^|[^`#{CC_WORD}])(?:(\Z)()|\[([^\]]+)\](?=(\\))?)?(\5?(`)([^`\s]|[^`\s]#{CC_ALL}*?\S)\7)(?![`#{CC_WORD}])/m],
577
580
  }
578
581
 
579
- # Matches an inline plus passthrough spanning multiple lines, but only when it occurs directly
580
- # inside constrained monospaced formatting in non-compat mode.
581
- #
582
- # Examples
583
- #
584
- # +text+
585
- #
586
- SinglePlusInlinePassRx = /^(\\)?\+(\S|\S#{CC_ALL}*?\S)\+$/m
587
-
588
582
  # Matches several variants of the passthrough inline macro, which may span multiple lines.
589
583
  #
590
584
  # Examples
@@ -526,9 +526,9 @@ module Substitutors
526
526
  if found_colon && (text.include? '://')
527
527
  # inline urls, target[text] (optionally prefixed with link: and optionally surrounded by <>)
528
528
  text = text.gsub InlineLinkRx do
529
- if (target = $2).start_with? RS
529
+ if (target = $2 + ($3 || $5)).start_with? RS
530
530
  # honor the escape
531
- next %(#{$1}#{target.slice 1, target.length}#{$4})
531
+ next ($&.slice 0, (rs_idx = $1.length)) + ($&.slice rs_idx + 1, $&.length)
532
532
  end
533
533
 
534
534
  prefix, suffix = $1, ''
@@ -543,15 +543,7 @@ module Substitutors
543
543
  when 'link:', ?", ?'
544
544
  next $&
545
545
  end
546
- case $3
547
- when ')', '?', '!'
548
- target = target.chop
549
- if (suffix = $3) == ')' && (target.end_with? '.', '?', '!')
550
- suffix = target[-1] + suffix
551
- target = target.chop
552
- end
553
- # NOTE handle case when modified target is a URI scheme (e.g., http://)
554
- next $& if target.end_with? '://'
546
+ case $6
555
547
  when ';'
556
548
  if (prefix.start_with? '&lt;') && (target.end_with? '&gt;')
557
549
  # move surrounding <> out of URL
@@ -755,7 +747,7 @@ module Substitutors
755
747
 
756
748
  if doc.compat_mode
757
749
  fragment = refid
758
- elsif (hash_idx = refid.index '#')
750
+ elsif (hash_idx = refid.index '#') && refid[hash_idx - 1] != '&'
759
751
  if hash_idx > 0
760
752
  if (fragment_len = refid.length - 1 - hash_idx) > 0
761
753
  path, fragment = (refid.slice 0, hash_idx), (refid.slice hash_idx + 1, fragment_len)
@@ -1027,11 +1019,17 @@ module Substitutors
1027
1019
  next %(#{$1}[#{attrlist}]#{RS * (escape_count - 1)}#{boundary}#{$5}#{boundary})
1028
1020
  elsif $1 == RS
1029
1021
  preceding = %([#{attrlist}])
1030
- else
1031
- if boundary == '++' && (attrlist.end_with? 'x-')
1022
+ elsif boundary == '++'
1023
+ if attrlist == 'x-'
1024
+ old_behavior = true
1025
+ attributes = {}
1026
+ elsif attrlist.end_with? ' x-'
1032
1027
  old_behavior = true
1033
- attrlist = attrlist.slice 0, attrlist.length - 2
1028
+ attributes = parse_quoted_text_attributes attrlist.slice 0, attrlist.length - 3
1029
+ else
1030
+ attributes = parse_quoted_text_attributes attrlist
1034
1031
  end
1032
+ else
1035
1033
  attributes = parse_quoted_text_attributes attrlist
1036
1034
  end
1037
1035
  elsif (escape_count = $3.length) > 0
@@ -1066,41 +1064,43 @@ module Substitutors
1066
1064
  pass_inline_char1, pass_inline_char2, pass_inline_rx = InlinePassRx[compat_mode]
1067
1065
  text = text.gsub pass_inline_rx do
1068
1066
  preceding = $1
1069
- attrlist = $2
1070
- escape_mark = RS if (quoted_text = $3).start_with? RS
1071
- format_mark = $4
1072
- content = $5
1067
+ attrlist = $4 || $3
1068
+ escaped = true if $5
1069
+ quoted_text = $6
1070
+ format_mark = $7
1071
+ content = $8
1073
1072
 
1074
1073
  if compat_mode
1075
1074
  old_behavior = true
1076
- elsif (old_behavior = attrlist && (attrlist.end_with? 'x-'))
1077
- attrlist = attrlist.slice 0, attrlist.length - 2
1075
+ elsif attrlist && (attrlist == 'x-' || (attrlist.end_with? ' x-'))
1076
+ old_behavior = old_behavior_forced = true
1078
1077
  end
1079
1078
 
1080
1079
  if attrlist
1081
- if format_mark == '`' && !old_behavior
1082
- next extract_inner_passthrough content, %(#{preceding}[#{attrlist}]#{escape_mark})
1083
- elsif escape_mark
1080
+ if escaped
1084
1081
  # honor the escape of the formatting mark
1085
1082
  next %(#{preceding}[#{attrlist}]#{quoted_text.slice 1, quoted_text.length})
1086
1083
  elsif preceding == RS
1087
1084
  # honor the escape of the attributes
1085
+ next %(#{preceding}[#{attrlist}]#{quoted_text}) if old_behavior_forced && format_mark == '`'
1088
1086
  preceding = %([#{attrlist}])
1087
+ elsif old_behavior_forced
1088
+ attributes = attrlist == 'x-' ? {} : (parse_quoted_text_attributes attrlist.slice 0, attrlist.length - 3)
1089
1089
  else
1090
1090
  attributes = parse_quoted_text_attributes attrlist
1091
1091
  end
1092
- elsif format_mark == '`' && !old_behavior
1093
- next extract_inner_passthrough content, %(#{preceding}#{escape_mark})
1094
- elsif escape_mark
1092
+ elsif escaped
1095
1093
  # honor the escape of the formatting mark
1096
1094
  next %(#{preceding}#{quoted_text.slice 1, quoted_text.length})
1095
+ elsif compat_mode && preceding == RS
1096
+ next quoted_text
1097
1097
  end
1098
1098
 
1099
1099
  if compat_mode
1100
1100
  passthrus[passthru_key = passthrus.size] = { text: content, subs: BASIC_SUBS, attributes: attributes, type: :monospaced }
1101
1101
  elsif attributes
1102
1102
  if old_behavior
1103
- subs = (format_mark == '`' ? BASIC_SUBS : NORMAL_SUBS)
1103
+ subs = format_mark == '`' ? BASIC_SUBS : NORMAL_SUBS
1104
1104
  passthrus[passthru_key = passthrus.size] = { text: content, subs: subs, attributes: attributes, type: :monospaced }
1105
1105
  else
1106
1106
  passthrus[passthru_key = passthrus.size] = { text: content, subs: BASIC_SUBS, attributes: attributes, type: :unquoted }
@@ -1399,20 +1399,6 @@ module Substitutors
1399
1399
  end.join LF)
1400
1400
  end
1401
1401
 
1402
- # Internal: Extract nested single-plus passthrough; otherwise return unprocessed
1403
- def extract_inner_passthrough text, pre
1404
- if (text.end_with? '+') && (text.start_with? '+', '\+') && SinglePlusInlinePassRx =~ text
1405
- if $1
1406
- %(#{pre}`+#{$2}+`)
1407
- else
1408
- @passthroughs[passthru_key = @passthroughs.size] = { text: $2, subs: BASIC_SUBS }
1409
- %(#{pre}`#{PASS_START}#{passthru_key}#{PASS_END}`)
1410
- end
1411
- else
1412
- %(#{pre}`#{text}`)
1413
- end
1414
- end
1415
-
1416
1402
  # Internal: Convert a quoted text region
1417
1403
  #
1418
1404
  # match - The MatchData for the quoted text region
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Asciidoctor
3
- VERSION = '2.0.18'
3
+ VERSION = '2.0.20'
4
4
  end
data/man/asciidoctor.1 CHANGED
@@ -1,13 +1,13 @@
1
1
  '\" t
2
2
  .\" Title: asciidoctor
3
3
  .\" Author: Dan Allen, Sarah White
4
- .\" Generator: Asciidoctor 2.0.17
5
- .\" Date: 2022-01-05
4
+ .\" Generator: Asciidoctor 2.0.19
5
+ .\" Date: 2018-03-20
6
6
  .\" Manual: Asciidoctor Manual
7
- .\" Source: Asciidoctor 2.0.17
7
+ .\" Source: Asciidoctor 2.0.20
8
8
  .\" Language: English
9
9
  .\"
10
- .TH "ASCIIDOCTOR" "1" "2022-01-05" "Asciidoctor 2.0.17" "Asciidoctor Manual"
10
+ .TH "ASCIIDOCTOR" "1" "2018-03-20" "Asciidoctor 2.0.20" "Asciidoctor Manual"
11
11
  .ie \n(.g .ds Aq \(aq
12
12
  .el .ds Aq '
13
13
  .ss \n[.ss] 0
@@ -67,10 +67,11 @@ If not set, the safe mode level defaults to \fIunsafe\fP when Asciidoctor is inv
67
67
  .RS 4
68
68
  Define, override, or unset a document attribute.
69
69
  Command\-line attributes take precedence over attributes defined in the source file unless either the name or value ends in \fI@\fP.
70
+ No substitutions are applied to the value.
70
71
  .sp
71
72
  \fIATTRIBUTE\fP is normally formatted as a key\-value pair, in the form \fINAME=VALUE\fP.
72
73
  Alternate forms are \fINAME\fP (where the \fIVALUE\fP defaults to an empty string), \fINAME!\fP (unsets the \fINAME\fP attribute), and \fINAME=VALUE@\fP (or \fINAME@=VALUE\fP) (where \fIVALUE\fP does not override the \fINAME\fP attribute if it\(cqs already defined in the source document).
73
- Values containing spaces should be enclosed in quotes.
74
+ A value containing spaces must be enclosed in quotes, in the form \fINAME="VALUE WITH SPACES"\fP.
74
75
  .sp
75
76
  This option may be specified more than once.
76
77
  .RE
@@ -263,4 +264,4 @@ Jason Porter wrote the first implementation of the CLI interface provided by thi
263
264
  .SH "COPYING"
264
265
  .sp
265
266
  Copyright (C) 2012\-present Dan Allen, Sarah White, Ryan Waldron, and the individual contributors to Asciidoctor.
266
- Use of this software is granted under the terms of the MIT License.
267
+ Use of this software is granted under the terms of the MIT License.
data/man/asciidoctor.adoc CHANGED
@@ -1,7 +1,7 @@
1
1
  = asciidoctor(1)
2
2
  Dan Allen; Sarah White
3
3
  :doctype: manpage
4
- :release-version: 2.0.17
4
+ :release-version: 2.0.20
5
5
  :man manual: Asciidoctor Manual
6
6
  :man source: Asciidoctor {release-version}
7
7
  ifdef::backend-manpage[:!author:]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoctor
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.18
4
+ version: 2.0.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Allen
@@ -63,14 +63,14 @@ dependencies:
63
63
  requirements:
64
64
  - - "~>"
65
65
  - !ruby/object:Gem::Version
66
- version: 5.2.0
66
+ version: 6.1.0
67
67
  type: :development
68
68
  prerelease: false
69
69
  version_requirements: !ruby/object:Gem::Requirement
70
70
  requirements:
71
71
  - - "~>"
72
72
  - !ruby/object:Gem::Version
73
- version: 5.2.0
73
+ version: 6.1.0
74
74
  - !ruby/object:Gem::Dependency
75
75
  name: minitest
76
76
  requirement: !ruby/object:Gem::Requirement
@@ -91,14 +91,14 @@ dependencies:
91
91
  requirements:
92
92
  - - "~>"
93
93
  - !ruby/object:Gem::Version
94
- version: 1.10.0
94
+ version: 1.13.0
95
95
  type: :development
96
96
  prerelease: false
97
97
  version_requirements: !ruby/object:Gem::Requirement
98
98
  requirements:
99
99
  - - "~>"
100
100
  - !ruby/object:Gem::Version
101
- version: 1.10.0
101
+ version: 1.13.0
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: rake
104
104
  requirement: !ruby/object:Gem::Requirement
@@ -188,6 +188,7 @@ files:
188
188
  - data/locale/attributes-sr.adoc
189
189
  - data/locale/attributes-sr_Latn.adoc
190
190
  - data/locale/attributes-sv.adoc
191
+ - data/locale/attributes-sw.adoc
191
192
  - data/locale/attributes-th.adoc
192
193
  - data/locale/attributes-tr.adoc
193
194
  - data/locale/attributes-uk.adoc
@@ -271,7 +272,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
271
272
  - !ruby/object:Gem::Version
272
273
  version: '0'
273
274
  requirements: []
274
- rubygems_version: 3.3.7
275
+ rubygems_version: 3.4.10
275
276
  signing_key:
276
277
  specification_version: 4
277
278
  summary: An implementation of the AsciiDoc text processor and publishing toolchain