asciidoctor 2.0.17 → 2.0.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c33baadb7f5d28211bbb55b0b2b002159d57d483d35d17fe1b11d72dd4389e53
4
- data.tar.gz: db81a673d28035c721612ab1c4f9d23e005a824384ac0ba1b1983e9e817d44e6
3
+ metadata.gz: 8ec8c2a1b561249c43342cc6d9fa2b970bc097ee4814c2e3b8e602fe259912b7
4
+ data.tar.gz: 2a096894e6fa57eee3857b07ca793e41ec6943524197c6f4a410fb08ac920147
5
5
  SHA512:
6
- metadata.gz: a1fae45fddd3696607f9337f35222ecfad106aa295d2f328b54af5c21404ddb0c59baf6424b180bf46e4fed36fa28a6042f2d90310bb8acea01da4790a80ba3f
7
- data.tar.gz: 0d65fb85055130df297d9ed12a63d68d03d5876c5b09f84d052396e793dada3a9406217969ac6574a3404b62113fb3afa7da235f6692ef2c1651904ecba00c71
6
+ metadata.gz: 8a22a6420efa77f814a864e23b9be00875bd4454e7d0cec8ca835ca5bf0a4976b27b4ca7baeacc6e7f5dc41647a4aa41b0383c8f26fc201d4e59634cdc8ca99a
7
+ data.tar.gz: 996d37bc44cf38e6cbf9d1e2c1088ebb3ace5e590a2f3ebb75ba09609107983fee462ad08f5e2f00b64138f0baeac59b7cc349b788e57808743f544f8614628a
data/CHANGELOG.adoc CHANGED
@@ -1,21 +1,89 @@
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.19 (2023-05-17) - @mojavelinux
20
+
21
+ Improvements::
22
+
23
+ * Return empty string instead of nil if raw or verbatim block has no lines
24
+ * Don't uppercase monospace span in section title in manpage output (#4402)
25
+ * Simplify processing of implicit link (i.e., autolink) by separating implicit and explicit match
26
+ * Generate partintro block consistently (#4450)
27
+ * Add Kiswahili translation for built-in labels (PR #4454) *@bkmgit*
28
+
29
+ Compliance::
30
+
31
+ * Fix call order so use of an include file with invalid encoding continues to raise error when using Ruby >= 3.2.0
32
+ * Fix test assertion for fallback Rouge stylesheet to be compatible with Rouge 4.1 (#4406) (*@tmzullinger*)
33
+ * Support `notitle` option on section as alternative to `untitled` to hide title (#4437)
34
+ * Add support for Haml 6 to template converter (#4429)
35
+
36
+ Bug Fixes::
37
+
38
+ * Process constrained inline passthrough inside monospace span (#4458)
39
+ * Catalog inline ref defined using anchor macro even when resolved reftext is empty
40
+ * Use while loop rather than recursion to locate next line to process; prevents stack limit error (#4368)
41
+ * Avoid matching numeric character references when searching for # in xref target (#4393)
42
+ * Use correct selector to collapse margin on first and last child of sidebar
43
+ * 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
44
+ * Manify alt text of block image in manpage output (#4401)
45
+ * Adjust font size of term in horizontal dlist to match font size of term in regular dlist
46
+ * Implicitly attach nested list that starts with block attribute lines to dlist entry (#4268)
47
+ * Don't swallow square brackets when processing escaped URL macro
48
+ * Treat `uri:classloader:` as an absolute path prefix when running on JRuby (#3929)
49
+ * Apply reftext substitutions to value of `mantitle` attribute in DocBook output (#4448)
50
+ * Enclose `<reftext>` tag in `<article>` tag in DocBook output for man page (#4452)
51
+ * Correctly handle compat role on monospace and constrained passthrough when box attrlist or formatted text is escaped
52
+
53
+ Build / Infrastructure::
54
+
55
+ * Update latest CRuby in CI workflow to 3.2
56
+ * Update latest JRuby in CI workflow to 9.4.2.0
57
+
58
+ === Details
59
+
60
+ {url-repo}/releases/tag/v2.0.19[git tag] | {url-repo}/compare/v2.0.18\...v2.0.19[source diff]
61
+ // end::compact[]
62
+
63
+ == 2.0.18 (2022-10-15) - @mojavelinux
64
+
65
+ Improvements::
66
+
67
+ * Propagate `:to_dir` option to document of AsciiDoc table cell (#4297)
68
+ * Force encoding of attribute data passed via CLI to UTF-8 if transcoding fails (#4351) (*@zkaip*)
69
+ * Add include role to link macro that replaces include directive when include is not enabled
70
+
71
+ Bug Fixes::
72
+
73
+ * Change internal `uriish?` helper to only detect a URI pattern at start of a string; avoids misleading messages (#4357)
74
+ * Prevent highlight.js warning when no language is set on source block; don't call `highlightBlock` if `data-lang` attribute is absent (#4263)
75
+ * Don't raise error if `Asciidoctor::Extensions.unregister` is called before groups are initialized (#4270)
76
+ * If path is included both partially and fully, store it with true value (included fully) in includes table of document catalog
77
+ * Reset registry if activate is called on it again (#4256)
78
+ * Format source location in exception message when extension code is malformed
79
+ * Fix lineno on reader when `skip-front-matter` attribute is set but end of front matter is not found
80
+ * Fix `Asciidoctor::Cli::Invoker` constructor when first argument is a hash
81
+ * Update default stylesheet to honor marker on unordered list when marker is defined on ancestor unordered list (#4361)
82
+
83
+ === Details
84
+
85
+ {url-repo}/releases/tag/v2.0.18[git tag] | {url-repo}/compare/v2.0.17\...v2.0.18[source diff]
86
+
19
87
  == 2.0.17 (2022-01-05) - @mojavelinux
20
88
 
21
89
  Bug Fixes::
@@ -27,12 +95,12 @@ Bug Fixes::
27
95
  * Change `AbstractBlock#sections?` to return false when called on block that isn't a Section or Document (PR #3591) *@mogztter*
28
96
  * Hide built-in marker on HTML summary element in Safari when using default stylesheet (#4162)
29
97
  * Hide outline around HTML summary when activated in Safari (#4162)
30
- * Include primary video in value of `playlist` attribute when embeddding YouTube video (#4156)
31
- * Honor stripes=none on nested table (#4165)
98
+ * Include primary video in value of `playlist` attribute when embedding YouTube video (#4156)
99
+ * Honor `stripes=none` on nested table (#4165)
32
100
  * Update default stylesheet to fix spacing around empty list item (#4184)
33
101
  * Honor `:header_only` option when parsing document with manpage doctype (#4192)
34
102
  * Use numeric character reference for closing square bracket around alt text of icon
35
- * Process author or authors document attribute in document header when implicit doctitle is absent (#4206)
103
+ * Process `author` or `authors` document attribute in document header when implicit doctitle is absent (#4206)
36
104
  * Patch open-uri-cached gem to work with Ruby 3.1 (update: drop patch now that open-uri-cached has been fixed) (#4227)
37
105
 
38
106
  Improvements::
@@ -43,7 +111,7 @@ Improvements::
43
111
  * Remove obsolete gist embed styles from default stylesheet
44
112
  * Allow `--failure-level` to be set to default value, `FATAL`
45
113
  * Sort levels in help for `--failure-level` option in ascending order
46
- * Invert FR translations for caution & warning admonition labels (#4212) (*cyChop*)
114
+ * Invert FR translations for caution & warning admonition labels (#4212) (*@cyChop*)
47
115
  * Add tests for open-uri-cached integration that is activated by the `cache-uri` attribute
48
116
  * Don't warn if negated tag is not found in include file (#4230)
49
117
 
@@ -55,7 +123,6 @@ Documentation::
55
123
  * Document how to enable and use the sourcemap (the `:sourcemap` option)
56
124
  * Document how to catalog additional assets (the `:catalog_assets` option)
57
125
 
58
- // end::compact[]
59
126
  == 2.0.16 (2021-08-03) - @mojavelinux
60
127
 
61
128
  Bug Fixes::
data/README-de.adoc CHANGED
@@ -1,6 +1,5 @@
1
1
  = Asciidoctor
2
2
  Dan Allen <https://github.com/mojavelinux[@mojavelinux]>; Sarah White <https://github.com/graphitefriction[@graphitefriction]>
3
- v2.0.17, 2022-01-05
4
3
  // settings:
5
4
  :idprefix:
6
5
  :idseparator: -
data/README-fr.adoc CHANGED
@@ -1,6 +1,5 @@
1
1
  = Asciidoctor
2
2
  Dan Allen <https://github.com/mojavelinux[@mojavelinux]>; Sarah White <https://github.com/graphitefriction[@graphitefriction]>
3
- v2.0.17, 2022-01-05
4
3
  // settings:
5
4
  :idprefix:
6
5
  :idseparator: -
data/README-jp.adoc CHANGED
@@ -1,6 +1,5 @@
1
1
  = Asciidoctor
2
2
  Dan Allen <https://github.com/mojavelinux[@mojavelinux]>; Sarah White <https://github.com/graphitefriction[@graphitefriction]>
3
- v2.0.17, 2022-01-05
4
3
  // settings:
5
4
  :idprefix:
6
5
  :idseparator: -
data/README-zh_CN.adoc CHANGED
@@ -1,6 +1,5 @@
1
1
  = Asciidoctor
2
2
  Dan Allen <https://github.com/mojavelinux[@mojavelinux]>; Sarah White <https://github.com/graphitefriction[@graphitefriction]>
3
- v2.0.17, 2022-01-05
4
3
  // settings:
5
4
  :page-layout: base
6
5
  :idprefix:
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.17, 2022-01-05
3
+ v2.0.19, 2023-05-17
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.18
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
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
18
18
  s.metadata = {
19
19
  'bug_tracker_uri' => 'https://github.com/asciidoctor/asciidoctor/issues',
20
20
  'changelog_uri' => 'https://github.com/asciidoctor/asciidoctor/blob/HEAD/CHANGELOG.adoc',
21
- 'mailing_list_uri' => 'http://discuss.asciidoctor.org',
21
+ 'mailing_list_uri' => 'https://chat.asciidoctor.org',
22
22
  'source_code_uri' => 'https://github.com/asciidoctor/asciidoctor'
23
23
  }
24
24
 
@@ -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
@@ -74,10 +74,10 @@ code{font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;font-weight:400;
74
74
  ul,ol,dl{line-height:1.6;margin-bottom:1.25em;list-style-position:outside;font-family:inherit}
75
75
  ul,ol{margin-left:1.5em}
76
76
  ul li ul,ul li ol{margin-left:1.25em;margin-bottom:0}
77
- ul.square li ul,ul.circle li ul,ul.disc li ul{list-style:inherit}
78
- ul.square{list-style-type:square}
79
77
  ul.circle{list-style-type:circle}
80
78
  ul.disc{list-style-type:disc}
79
+ ul.square{list-style-type:square}
80
+ ul.circle ul:not([class]),ul.disc ul:not([class]),ul.square ul:not([class]){list-style:inherit}
81
81
  ol li ul,ol li ol{margin-left:1.25em;margin-bottom:0}
82
82
  dl dt{margin-bottom:.3125em;font-weight:bold}
83
83
  dl dd{margin-bottom:1.25em}
@@ -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,14 +116,14 @@ 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?
123
123
  result.join LF
124
124
  end
125
125
  else
126
- logger.warn %(Unknown content model '#{@content_model}' for block: #{self}) unless @content_model == :empty
126
+ logger.warn %(unknown content model '#{@content_model}' for block: #{self}) unless @content_model == :empty
127
127
  nil
128
128
  end
129
129
  end
@@ -19,7 +19,7 @@ module Asciidoctor
19
19
  when Options
20
20
  @options = first_option
21
21
  when ::Hash
22
- @options = Options.new options
22
+ @options = Options.new first_option
23
23
  else
24
24
  if ::Integer === (result = Options.parse! options)
25
25
  @code = result
@@ -85,7 +85,11 @@ module Asciidoctor
85
85
  'this attribute takes precedence over the same attribute defined in the source document',
86
86
  'unless either the name or value ends in @ (i.e., name@=value or name=value@)') do |attr|
87
87
  next if (attr = attr.rstrip).empty? || attr == '='
88
- attr = attr.encode UTF_8 unless attr.encoding == UTF_8
88
+ begin
89
+ attr = attr.encode UTF_8
90
+ rescue ::EncodingError
91
+ attr = attr.force_encoding UTF_8
92
+ end unless attr.encoding == UTF_8
89
93
  name, _, val = attr.partition '='
90
94
  self[:attributes][name] = val
91
95
  end
@@ -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
@@ -257,6 +257,7 @@ class Document < AbstractBlock
257
257
  @parent_document = parent_doc
258
258
  options[:base_dir] ||= parent_doc.base_dir
259
259
  options[:catalog_assets] = true if parent_doc.options[:catalog_assets]
260
+ options[:to_dir] = parent_doc.options[:to_dir] if parent_doc.options[:to_dir]
260
261
  @catalog = parent_doc.catalog.merge footnotes: []
261
262
  # QUESTION should we support setting attribute in parent document from nested document?
262
263
  @attribute_overrides = attr_overrides = (parent_doc.instance_variable_get :@attribute_overrides).merge parent_doc.attributes
@@ -513,7 +513,12 @@ module Extensions
513
513
  #
514
514
  # If the process method returns an instance of Block, the content model of that
515
515
  # Block is :compound, and the Block contains at least one line, the parser will
516
- # parse those lines into blocks an assigned them to the returned block.
516
+ # parse those lines into blocks and append them to the returned block.
517
+ #
518
+ # If your custom block can be applied to a paragraph or delimited block, and you
519
+ # want to preserve the content model of the input, check whether the value of
520
+ # the cloaked-context attribute is :paragraph. If it is, set the content model of
521
+ # the returned block to :simple. Otherwise, set the content model to :compound.
517
522
  #
518
523
  # AsciiDoc example:
519
524
  #
@@ -716,6 +721,7 @@ module Extensions
716
721
 
717
722
  def initialize groups = {}
718
723
  @groups = groups
724
+ reset
719
725
  @preprocessor_extensions = @tree_processor_extensions = @postprocessor_extensions = @include_processor_extensions = @docinfo_processor_extensions = @block_extensions = @block_macro_extensions = @inline_macro_extensions = nil
720
726
  @document = nil
721
727
  end
@@ -727,6 +733,7 @@ module Extensions
727
733
  #
728
734
  # Returns the instance of this [Registry].
729
735
  def activate document
736
+ reset if @document
730
737
  @document = document
731
738
  unless (ext_groups = Extensions.groups.values + @groups.values).empty?
732
739
  ext_groups.each do |group|
@@ -1102,6 +1109,9 @@ module Extensions
1102
1109
  # Public: Checks whether any {BlockProcessor} extensions are registered to
1103
1110
  # handle the specified block name appearing on the specified context.
1104
1111
  #
1112
+ # This method assumes you've called blocks? first to check whether any
1113
+ # block extensions are registered.
1114
+ #
1105
1115
  # Returns the [Extension] proxy object for the BlockProcessor that matches
1106
1116
  # the block name and context or false if no match is found.
1107
1117
  def registered_for_block? name, context
@@ -1117,6 +1127,9 @@ module Extensions
1117
1127
  #
1118
1128
  # name - the String or Symbol (coersed to a Symbol) macro name
1119
1129
  #
1130
+ # This method assumes you've called blocks? first to check whether any
1131
+ # block extensions are registered.
1132
+ #
1120
1133
  # Returns the [Extension] object stored in the registry that proxies the
1121
1134
  # corresponding BlockProcessor or nil if a match is not found.
1122
1135
  def find_block_extension name
@@ -1193,6 +1206,9 @@ module Extensions
1193
1206
  #
1194
1207
  # name - the String or Symbol (coersed to a Symbol) macro name
1195
1208
  #
1209
+ # This method assumes you've called block_macros? first to check whether any
1210
+ # block macro extensions are registered.
1211
+ #
1196
1212
  # Returns the [Extension] proxy object for the BlockMacroProcessor that matches
1197
1213
  # the macro name or false if no match is found.
1198
1214
  #--
@@ -1206,6 +1222,9 @@ module Extensions
1206
1222
  #
1207
1223
  # name - the String or Symbol (coersed to a Symbol) macro name
1208
1224
  #
1225
+ # This method assumes you've called block_macros? first to check whether any
1226
+ # block macro extensions are registered.
1227
+ #
1209
1228
  # Returns the [Extension] object stored in the registry that proxies the
1210
1229
  # corresponding BlockMacroProcessor or nil if a match is not found.
1211
1230
  def find_block_macro_extension name
@@ -1282,6 +1301,9 @@ module Extensions
1282
1301
  #
1283
1302
  # name - the String or Symbol (coersed to a Symbol) macro name
1284
1303
  #
1304
+ # This method assumes you've called inline_macros? first to check whether any
1305
+ # inline macro extensions are registered.
1306
+ #
1285
1307
  # Returns the [Extension] proxy object for the InlineMacroProcessor that matches
1286
1308
  # the macro name or false if no match is found.
1287
1309
  def registered_for_inline_macro? name
@@ -1293,6 +1315,9 @@ module Extensions
1293
1315
  #
1294
1316
  # name - the String or Symbol (coersed to a Symbol) macro name
1295
1317
  #
1318
+ # This method assumes you've called inline_macros? first to check whether any
1319
+ # inline macro extensions are registered.
1320
+ #
1296
1321
  # Returns the [Extension] object stored in the registry that proxies the
1297
1322
  # corresponding InlineMacroProcessor or nil if a match is not found.
1298
1323
  def find_inline_macro_extension name
@@ -1302,6 +1327,9 @@ module Extensions
1302
1327
  # Public: Retrieves the {Extension} proxy objects for all
1303
1328
  # InlineMacroProcessor instances in this registry.
1304
1329
  #
1330
+ # This method assumes you've called inline_macros? first to check whether any
1331
+ # inline macro extensions are registered.
1332
+ #
1305
1333
  # Returns an [Array] of Extension proxy objects.
1306
1334
  def inline_macros
1307
1335
  @inline_macro_extensions.values
@@ -1345,7 +1373,7 @@ module Extensions
1345
1373
  yield processor
1346
1374
  end
1347
1375
  unless processor.process_block_given?
1348
- raise ::ArgumentError, %(No block specified to process #{kind_name} extension at #{block.source_location})
1376
+ raise ::NoMethodError, %(No block specified to process #{kind_name} extension at #{block.source_location.join ':'})
1349
1377
  end
1350
1378
  processor.freeze
1351
1379
  extension = ProcessorExtension.new kind, processor
@@ -1389,10 +1417,10 @@ module Extensions
1389
1417
  yield processor
1390
1418
  end
1391
1419
  unless (name = as_symbol processor.name)
1392
- raise ::ArgumentError, %(No name specified for #{kind_name} extension at #{block.source_location})
1420
+ raise ::ArgumentError, %(No name specified for #{kind_name} extension at #{block.source_location.join ':'})
1393
1421
  end
1394
1422
  unless processor.process_block_given?
1395
- raise ::NoMethodError, %(No block specified to process #{kind_name} extension at #{block.source_location})
1423
+ raise ::NoMethodError, %(No block specified to process #{kind_name} extension at #{block.source_location.join ':'})
1396
1424
  end
1397
1425
  processor.freeze
1398
1426
  kind_store[name] = ProcessorExtension.new kind, processor
@@ -1424,6 +1452,11 @@ module Extensions
1424
1452
  end
1425
1453
  end
1426
1454
 
1455
+ def reset
1456
+ @preprocessor_extensions = @tree_processor_extensions = @postprocessor_extensions = @include_processor_extensions = @docinfo_processor_extensions = @block_extensions = @block_macro_extensions = @inline_macro_extensions = nil
1457
+ @document = nil
1458
+ end
1459
+
1427
1460
  def resolve_args args, expect
1428
1461
  opts = ::Hash === args[-1] ? args.pop : {}
1429
1462
  return opts if expect == 1
@@ -1528,7 +1561,7 @@ module Extensions
1528
1561
  #
1529
1562
  # Returns nothing
1530
1563
  def unregister *names
1531
- names.each {|group| @groups.delete group.to_sym }
1564
+ names.each_with_object(groups) {|group, catalog| catalog.delete group.to_sym }
1532
1565
  nil
1533
1566
  end
1534
1567
  end