asciidoctor 2.0.13 → 2.0.14

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: a9e72633de0c6754af3817cb79f6dbb3837a14b6ed1dd4c9f2e22bb600460bff
4
- data.tar.gz: ad8533870d76be07168b23cec5c8e53aa9e6128e30535650d827ffade7fad92d
3
+ metadata.gz: 6e012ef88ccf5e32405cd49a342bb89a6f6670b092fb9df0053a23b02a271bcf
4
+ data.tar.gz: e2e867e672262616fbfb4957d0155644e1209919670adf9fde4d6609c74ed808
5
5
  SHA512:
6
- metadata.gz: db1c156201c46129fea64fdfa08b40a7892ef655856ec679e81caad32fa5601da67de7bfd5e47f7a811813cf6efe78c3f958e4b294ac29fbf105ebb6725115d9
7
- data.tar.gz: d6656dca3af8847229c556063bf0ed2ec5db03129a7af0d2bfaf65e400e5bb95fb571b9378c367ed2305b967fb33ce0c7085cc2e1740d653c360d079fff386f5
6
+ metadata.gz: 54cacdc574dc500a77fc851dcb4f48d9b5ba160f81e8edc554d0fa81f54afd495c106e3b2dc6e5a73a841da816e1c6832ff818c61e8d026b622262a6e7a9c1c6
7
+ data.tar.gz: 8413580ffda7fac9265491a88ab37b8c80fa13509e5f9b2ebbca165a5c8aad047c2b27e75f881168a3dd001b32e8980b52718fedafd183531a45e87364d7e9a7
data/CHANGELOG.adoc CHANGED
@@ -14,6 +14,29 @@ This document provides a high-level view of the changes introduced in Asciidocto
14
14
  For a detailed view of what has changed, refer to the {uri-repo}/commits/master[commit history] on GitHub.
15
15
 
16
16
  // tag::compact[]
17
+ == 2.0.14 (2021-04-19) - @mojavelinux
18
+
19
+ Bug Fixes::
20
+
21
+ * Don't allow AsciiDoc table cell to set document attribute that was unset from the API (exceptions include: `compat-mode`, `toc`, `showtitle`, and `notitle`) (#4017)
22
+ * Ensure default document attributes unset in parent document remain unset in AsciiDoc table cell (#2586)
23
+ * Allow the `showtitle` / `notitle` attribute to be toggled in an AsciiDoc table cell if set or unset in parent document (#4018)
24
+ * Ensure mtime of input file honors TZ environment variable on JRuby for Windows (affects value of `docdatetime` attribute) (#3550)
25
+ * Honor caption attribute on blocks that support captioned title even if corresponding `*-caption` document attribute (e.g., `example-caption`) is not set (#4023)
26
+ * Suppress missing attribute warning when applying substitutions to implicit document title for assignment to intrinsic `doctitle` attribute (#4024)
27
+ * Increment counter (but not the corresponding attribute) if attribute is locked (#4013)
28
+
29
+ Improvements::
30
+
31
+ * Use attribute, if set, as seed value for counter even if not already registered as a counter (#4014)
32
+ * Allow subs attribute value on Inline node returned by process method for custom inline macro to be a String (#3938)
33
+ * Allow value of `user-home` attribute to be overridden by API or CLI (#3732)
34
+
35
+ Build / Infrastructure::
36
+
37
+ * Run tests on JRuby for Windows (#3550)
38
+
39
+ // end::compact[]
17
40
  == 2.0.13 (2021-04-10) - @mojavelinux
18
41
 
19
42
  Bug Fixes::
@@ -50,7 +73,6 @@ Documentation::
50
73
  * Import documentation for processor into this repository (#3861) (*@graphitefriction*)
51
74
  * Add Belarusian translation of built-in attributes (PR #3928) (*@morganov*)
52
75
 
53
- // end::compact[]
54
76
  == 2.0.12 (2020-11-10) - @mojavelinux
55
77
 
56
78
  Bug Fixes::
@@ -443,7 +465,7 @@ Bug Fixes::
443
465
  Build / Infrastructure::
444
466
 
445
467
  * clear SOURCE_DATE_EPOCH env var when testing timezones (PR #2969) (*@aerostitch*)
446
- * remove compat folder (removes the AsciiDoc Python config file that provides pseudo-compliance with Asciidoctor and a stylesheet for an old Font Awesome migration)
468
+ * remove compat folder (removes the AsciiDoc.py config file that provides pseudo-compliance with Asciidoctor and a stylesheet for an old Font Awesome migration)
447
469
  * add Ruby 2.6.0 to build matrix
448
470
  * stop running CI job on unsupported versions of Ruby
449
471
  * exclude test suite, build script, and Gemfile from gem (#3044)
@@ -1634,13 +1656,13 @@ Compliance::
1634
1656
  * skip include directives when processing comment blocks
1635
1657
  * added xmlns to root element in docbook45 backend, set noxmlns attribute to disable
1636
1658
  * added a Compliance module to control compliance-related behavior
1637
- * added linkattrs feature to AsciiDoc compatibility file (#441)
1638
- * added level-5 heading to AsciiDoc compatibility file (#388)
1639
- * added new XML-based callouts to AsciiDoc compatibility file
1640
- * added absolute and uri image target matching to AsciiDoc compatibility file
1641
- * added float attribute on inline image macro to AsciiDoc compatibility file
1642
- * removed linkcss in AsciiDoc compatibility file
1643
- * fixed fenced code entry in compatibility file
1659
+ * added linkattrs feature to AsciiDoc.py compatibility file (#441)
1660
+ * added level-5 heading to AsciiDoc.py compatibility file (#388)
1661
+ * added new XML-based callouts to AsciiDoc.py compatibility file
1662
+ * added absolute and uri image target matching to AsciiDoc.py compatibility file
1663
+ * added float attribute on inline image macro to AsciiDoc.py compatibility file
1664
+ * removed linkcss in AsciiDoc.py compatibility file
1665
+ * fixed fenced code entry in AsciiDoc.py compatibility file
1644
1666
 
1645
1667
  Bug Fixes::
1646
1668
 
@@ -1738,7 +1760,7 @@ Enhancements::
1738
1760
 
1739
1761
  Compliance::
1740
1762
 
1741
- * ~ 99.5% compliance with AsciiDoc
1763
+ * ~ 99.5% compliance with AsciiDoc.py
1742
1764
  * drop line if target of include directive is blank (#376)
1743
1765
  * resolve attribute references in target of include directive (#367)
1744
1766
  * added irc scheme to link detection (#314)
@@ -1799,7 +1821,7 @@ Enhancements::
1799
1821
 
1800
1822
  Compliance::
1801
1823
 
1802
- * added AsciiDoc compatibility file to make AsciiDoc behave like Asciidoctor (#257)
1824
+ * added compatibility file to make AsciiDoc.py behave like Asciidoctor (#257)
1803
1825
  * restore alpha-based xml entities (#211)
1804
1826
  * implement video and audio block macros (#155)
1805
1827
  * implement toc block macro (#269)
@@ -1899,7 +1921,7 @@ Enhancements::
1899
1921
  * added hardbreaks option to preserve line breaks in paragraph text (#119)
1900
1922
  * :header_footer option defaults to false when using the API, unless rendering to file
1901
1923
  * added idseparator attribute to customized separator used in generated section ids
1902
- * do not number special sections (differs from AsciiDoc)
1924
+ * do not number special sections (differs from AsciiDoc.py)
1903
1925
 
1904
1926
  Compliance::
1905
1927
 
data/README-de.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]>; Ryan Waldron <https://github.com/erebor[@erebor]>
3
- v2.0.13, 2021-04-10
3
+ v2.0.14, 2021-04-19
4
4
  // settings:
5
5
  :idprefix:
6
6
  :idseparator: -
@@ -17,7 +17,7 @@ ifdef::env-github[]
17
17
  :warning-caption: :warning:
18
18
  endif::[]
19
19
  // Variables:
20
- :release-version: 2.0.13
20
+ :release-version: 2.0.14
21
21
  // URIs:
22
22
  :uri-org: https://github.com/asciidoctor
23
23
  :uri-repo: {uri-org}/asciidoctor
data/README-fr.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]>; Ryan Waldron <https://github.com/erebor[@erebor]>
3
- v2.0.13, 2021-04-10
3
+ v2.0.14, 2021-04-19
4
4
  // settings:
5
5
  :idprefix:
6
6
  :idseparator: -
@@ -17,7 +17,7 @@ ifdef::env-github[]
17
17
  :warning-caption: :warning:
18
18
  endif::[]
19
19
  // Variables:
20
- :release-version: 2.0.13
20
+ :release-version: 2.0.14
21
21
  // URIs:
22
22
  :uri-org: https://github.com/asciidoctor
23
23
  :uri-repo: {uri-org}/asciidoctor
data/README-jp.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]>; Ryan Waldron <https://github.com/erebor[@erebor]>
3
- v2.0.13, 2021-04-10
3
+ v2.0.14, 2021-04-19
4
4
  // settings:
5
5
  :idprefix:
6
6
  :idseparator: -
@@ -17,7 +17,7 @@ ifdef::env-github[]
17
17
  :warning-caption: :warning:
18
18
  endif::[]
19
19
  // Variables:
20
- :release-version: 2.0.13
20
+ :release-version: 2.0.14
21
21
  // URIs:
22
22
  :uri-org: https://github.com/asciidoctor
23
23
  :uri-repo: {uri-org}/asciidoctor
data/README-zh_CN.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]>; Ryan Waldron <https://github.com/erebor[@erebor]>
3
- v2.0.13, 2021-04-10
3
+ v2.0.14, 2021-04-19
4
4
  // settings:
5
5
  :page-layout: base
6
6
  :idprefix:
@@ -18,7 +18,7 @@ ifdef::env-github[]
18
18
  :warning-caption: :warning:
19
19
  endif::[]
20
20
  // Variables:
21
- :release-version: 2.0.13
21
+ :release-version: 2.0.14
22
22
  // URIs:
23
23
  :uri-org: https://github.com/asciidoctor
24
24
  :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]>; Ryan Waldron <https://github.com/erebor[@erebor]>
3
- v2.0.13, 2021-04-10
3
+ v2.0.14, 2021-04-19
4
4
  // settings:
5
5
  :idprefix:
6
6
  :idseparator: -
@@ -17,7 +17,7 @@ ifdef::env-github[]
17
17
  :warning-caption: :warning:
18
18
  endif::[]
19
19
  // Variables:
20
- :release-version: 2.0.13
20
+ :release-version: 2.0.14
21
21
  // URLs:
22
22
  :url-org: https://github.com/asciidoctor
23
23
  :url-repo: {url-org}/asciidoctor
data/lib/asciidoctor.rb CHANGED
@@ -332,7 +332,7 @@ module Asciidoctor
332
332
 
333
333
  LIST_CONTINUATION = '+'
334
334
 
335
- # NOTE AsciiDoc Python allows + to be preceded by TAB; Asciidoctor does not
335
+ # NOTE AsciiDoc.py allows + to be preceded by TAB; Asciidoctor does not
336
336
  HARD_LINE_BREAK = ' +'
337
337
 
338
338
  LINE_CONTINUATION = ' \\'
@@ -459,9 +459,9 @@ module Asciidoctor
459
459
  [:emphasis, :unconstrained, /\\?(?:\[([^\]]+)\])?__(#{CC_ALL}+?)__/m],
460
460
  # _emphasis_
461
461
  [:emphasis, :constrained, /(^|[^#{CC_WORD};:}])(?:\[([^\]]+)\])?_(\S|\S#{CC_ALL}*?\S)_(?!#{CG_WORD})/m],
462
- # ##mark## (referred to in AsciiDoc Python as unquoted)
462
+ # ##mark## (referred to in AsciiDoc.py as unquoted)
463
463
  [:mark, :unconstrained, /\\?(?:\[([^\]]+)\])?##(#{CC_ALL}+?)##/m],
464
- # #mark# (referred to in AsciiDoc Python as unquoted)
464
+ # #mark# (referred to in AsciiDoc.py as unquoted)
465
465
  [:mark, :constrained, /(^|[^#{CC_WORD}&;:}])(?:\[([^\]]+)\])?#(\S|\S#{CC_ALL}*?\S)#(?!#{CG_WORD})/m],
466
466
  # ^superscript^
467
467
  [:superscript, :unconstrained, /\\?(?:\[([^\]]+)\])?\^(\S+?)\^/],
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
  module Asciidoctor
3
3
  # A built-in {Converter} implementation that generates DocBook 5 output. The output is inspired by the output produced
4
- # by the docbook45 backend from AsciiDoc Python, except it has been migrated to the DocBook 5 specification.
4
+ # by the docbook45 backend from AsciiDoc.py, except it has been migrated to the DocBook 5 specification.
5
5
  class Converter::DocBook5Converter < Converter::Base
6
6
  register_for 'docbook5'
7
7
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
  module Asciidoctor
3
3
  # A built-in {Converter} implementation that generates HTML 5 output
4
- # consistent with the html5 backend from AsciiDoc Python.
4
+ # consistent with the html5 backend from AsciiDoc.py.
5
5
  class Converter::Html5Converter < Converter::Base
6
6
  register_for 'html5'
7
7
 
@@ -5,7 +5,7 @@ module Asciidoctor
5
5
  # The output of this converter adheres to the man definition as defined by
6
6
  # groff and uses the manpage output of the DocBook toolchain as a foundation.
7
7
  # That means if you've previously been generating man pages using the a2x tool
8
- # from AsciiDoc Python, you should be able to achieve a very similar result
8
+ # from AsciiDoc.py, you should be able to achieve a very similar result
9
9
  # using this converter. Though you'll also get to enjoy some notable
10
10
  # enhancements that have been added since, such as the customizable linkstyle.
11
11
  #
@@ -259,12 +259,14 @@ class Document < AbstractBlock
259
259
  options[:catalog_assets] = true if parent_doc.options[:catalog_assets]
260
260
  @catalog = parent_doc.catalog.merge footnotes: []
261
261
  # QUESTION should we support setting attribute in parent document from nested document?
262
- # NOTE we must dup or else all the assignments to the overrides clobbers the real attributes
263
- @attribute_overrides = attr_overrides = parent_doc.attributes.merge
264
- parent_doctype = attr_overrides.delete 'doctype'
262
+ @attribute_overrides = attr_overrides = (parent_doc.instance_variable_get :@attribute_overrides).merge parent_doc.attributes
265
263
  attr_overrides.delete 'compat-mode'
264
+ parent_doctype = attr_overrides.delete 'doctype'
265
+ attr_overrides.delete 'notitle'
266
+ attr_overrides.delete 'showtitle'
267
+ # QUESTION if toc is hard unset in parent document, should it be hard unset in nested document?
266
268
  attr_overrides.delete 'toc'
267
- attr_overrides.delete 'toc-placement'
269
+ @attributes['toc-placement'] = (attr_overrides.delete 'toc-placement') || 'auto'
268
270
  attr_overrides.delete 'toc-position'
269
271
  @safe = parent_doc.safe
270
272
  @attributes['compat-mode'] = '' if (@compat_mode = parent_doc.compat_mode)
@@ -339,11 +341,13 @@ class Document < AbstractBlock
339
341
  (@options = options).freeze
340
342
 
341
343
  attrs = @attributes
342
- attrs['attribute-undefined'] = Compliance.attribute_undefined
343
- attrs['attribute-missing'] = Compliance.attribute_missing
344
- attrs.update DEFAULT_ATTRIBUTES
345
- # TODO if lang attribute is set, @safe mode < SafeMode::SERVER, and !parent_doc,
346
- # load attributes from data/locale/attributes-<lang>.adoc
344
+ unless parent_doc
345
+ attrs['attribute-undefined'] = Compliance.attribute_undefined
346
+ attrs['attribute-missing'] = Compliance.attribute_missing
347
+ attrs.update DEFAULT_ATTRIBUTES
348
+ # TODO if lang attribute is set, @safe mode < SafeMode::SERVER, and !parent_doc,
349
+ # load attributes from data/locale/attributes-<lang>.adoc
350
+ end
347
351
 
348
352
  if standalone
349
353
  # sync embedded attribute with :standalone option value
@@ -371,14 +375,12 @@ class Document < AbstractBlock
371
375
  attr_overrides[%(safe-mode-#{safe_mode_name})] = ''
372
376
  attr_overrides['safe-mode-level'] = @safe
373
377
 
374
- # the only way to set the max-include-depth attribute is via the API; default to 64 like AsciiDoc Python
378
+ # the only way to set the max-include-depth attribute is via the API; default to 64 like AsciiDoc.py
375
379
  attr_overrides['max-include-depth'] ||= 64
376
380
 
377
381
  # the only way to set the allow-uri-read attribute is via the API; disabled by default
378
382
  attr_overrides['allow-uri-read'] ||= nil
379
383
 
380
- attr_overrides['user-home'] = USER_HOME
381
-
382
384
  # remap legacy attribute names
383
385
  attr_overrides['sectnums'] = attr_overrides.delete 'numbered' if attr_overrides.key? 'numbered'
384
386
  attr_overrides['hardbreaks-option'] = attr_overrides.delete 'hardbreaks' if attr_overrides.key? 'hardbreaks'
@@ -414,7 +416,7 @@ class Document < AbstractBlock
414
416
  attr_overrides['docfile'] = attr_overrides['docfile'][(attr_overrides['docdir'].length + 1)..-1]
415
417
  end
416
418
  attr_overrides['docdir'] = ''
417
- attr_overrides['user-home'] = '.'
419
+ attr_overrides['user-home'] ||= '.'
418
420
  if @safe >= SafeMode::SECURE
419
421
  attr_overrides['max-attribute-value-size'] = 4096 unless attr_overrides.key? 'max-attribute-value-size'
420
422
  # assign linkcss (preventing css embedding) unless explicitly disabled from the commandline or API
@@ -423,6 +425,8 @@ class Document < AbstractBlock
423
425
  # restrict document from enabling icons
424
426
  attr_overrides['icons'] ||= nil
425
427
  end
428
+ else
429
+ attr_overrides['user-home'] ||= USER_HOME
426
430
  end
427
431
 
428
432
  # the only way to set the max-attribute-value-size attribute is via the API; disabled by default
@@ -562,15 +566,17 @@ class Document < AbstractBlock
562
566
  # returns the next number in the sequence for the specified counter
563
567
  def counter name, seed = nil
564
568
  return @parent_document.counter name, seed if @parent_document
565
- if attribute_locked? name
566
- @attributes[name]
567
- elsif (attr_seed = !(attr_val = @attributes[name]).nil_or_empty?) && (@counters.key? name)
568
- @attributes[name] = @counters[name] = Helpers.nextval attr_val
569
+ if (locked = attribute_locked? name) && (curr_val = @counters[name])
570
+ next_val = @counters[name] = Helpers.nextval curr_val
571
+ elsif !(curr_val = @attributes[name]).nil_or_empty?
572
+ next_val = @counters[name] = Helpers.nextval curr_val
569
573
  elsif seed
570
- @attributes[name] = @counters[name] = seed == seed.to_i.to_s ? seed.to_i : seed
574
+ next_val = @counters[name] = seed == seed.to_i.to_s ? seed.to_i : seed
571
575
  else
572
- @attributes[name] = @counters[name] = Helpers.nextval attr_seed ? attr_val : 0
576
+ next_val = @counters[name] = 1
573
577
  end
578
+ @attributes[name] = next_val unless locked
579
+ next_val
574
580
  end
575
581
 
576
582
  # Public: Increment the specified counter and store it in the block's attributes
@@ -53,7 +53,8 @@ module Asciidoctor
53
53
  end
54
54
 
55
55
  if ::File === input
56
- options[:input_mtime] = input.mtime
56
+ # File#mtime on JRuby for Windows doesn't honor TZ environment variable; see https://github.com/jruby/jruby/issues/6659
57
+ options[:input_mtime] = RUBY_ENGINE == 'jruby' ? (::Time.at input.mtime.to_i) : input.mtime
57
58
  # NOTE defer setting infile and indir until we get a better sense of their purpose
58
59
  # TODO cli checks if input path can be read and is file, but might want to add check to API too
59
60
  attrs['docfile'] = input_path = ::File.absolute_path input.path
@@ -144,7 +144,10 @@ class Parser
144
144
  l0_section_title = nil
145
145
  else
146
146
  document.title = l0_section_title
147
- doc_attrs['doctitle'] = doctitle_attr_val = document.apply_header_subs l0_section_title
147
+ if (doc_attrs['doctitle'] = doctitle_attr_val = document.sub_specialchars l0_section_title).include? ATTR_REF_HEAD
148
+ # QUESTION should we defer substituting attributes until the end of the header? or should we substitute again if necessary?
149
+ doc_attrs['doctitle'] = doctitle_attr_val = document.sub_attributes doctitle_attr_val, attribute_missing: 'skip'
150
+ end
148
151
  end
149
152
  document.header.source_location = source_location if source_location
150
153
  # default to compat-mode if document has setext doctitle
@@ -905,9 +908,7 @@ class Parser
905
908
  # FIXME title and caption should be assigned when block is constructed (though we need to handle all cases)
906
909
  if attributes['title']
907
910
  block.title = block_title = attributes.delete 'title'
908
- if (caption_attr_name = CAPTION_ATTRIBUTE_NAMES[block.context]) && document.attributes[caption_attr_name]
909
- block.assign_caption (attributes.delete 'caption')
910
- end
911
+ block.assign_caption (attributes.delete 'caption') if CAPTION_ATTRIBUTE_NAMES[block.context]
911
912
  end
912
913
  # TODO eventually remove the style attribute from the attributes hash
913
914
  #block.style = attributes.delete 'style'
@@ -1319,7 +1320,7 @@ class Parser
1319
1320
  list_item.marker = sibling_trait
1320
1321
  if ordinal == 0 && !style
1321
1322
  # using list level makes more sense, but we don't track it
1322
- # basing style on marker level is compliant with AsciiDoc Python
1323
+ # basing style on marker level is compliant with AsciiDoc.py
1323
1324
  list_block.style = implicit_style || ((ORDERED_LIST_STYLES[sibling_trait.length - 1] || 'arabic').to_s)
1324
1325
  end
1325
1326
  if item_text.start_with?('[[') && LeadingInlineAnchorRx =~ item_text
@@ -592,7 +592,7 @@ module Asciidoctor
592
592
  # $$text$$
593
593
  # pass:quotes[text]
594
594
  #
595
- # NOTE we have to support an empty pass:[] for compatibility with AsciiDoc Python
595
+ # NOTE we have to support an empty pass:[] for compatibility with AsciiDoc.py
596
596
  InlinePassMacroRx = /(?:(?:(\\?)\[([^\]]+)\])?(\\{0,2})(\+\+\+?|\$\$)(#{CC_ALL}*?)\4|(\\?)pass:([a-z]+(?:,[a-z-]+)*)?\[(|#{CC_ALL}*?[^\\])\])/m
597
597
 
598
598
  # Matches an xref (i.e., cross-reference) inline macro, which may span multiple lines.
@@ -611,7 +611,7 @@ module Asciidoctor
611
611
  # Matches a trailing + preceded by at least one space character,
612
612
  # which forces a hard line break (<br> tag in HTML output).
613
613
  #
614
- # NOTE AsciiDoc Python allows + to be preceded by TAB; Asciidoctor does not
614
+ # NOTE AsciiDoc.py allows + to be preceded by TAB; Asciidoctor does not
615
615
  #
616
616
  # Examples
617
617
  #
@@ -331,8 +331,8 @@ module Substitutors
331
331
  target ||= ext_config[:format] == :short ? content : target
332
332
  end
333
333
  if (Inline === (replacement = extension.process_method[self, target, attributes]))
334
- if (inline_subs = replacement.attributes.delete 'subs')
335
- replacement.text = apply_subs replacement.text, (expand_subs inline_subs)
334
+ if (inline_subs = replacement.attributes.delete 'subs') && (inline_subs = expand_subs inline_subs, 'custom inline macro')
335
+ replacement.text = apply_subs replacement.text, inline_subs
336
336
  end
337
337
  replacement.convert
338
338
  elsif replacement
@@ -1118,7 +1118,7 @@ module Substitutors
1118
1118
  end
1119
1119
  subs = $2
1120
1120
  content = normalize_text $3, nil, true
1121
- # NOTE drop enclosing $ signs around latexmath for backwards compatibility with AsciiDoc Python
1121
+ # NOTE drop enclosing $ signs around latexmath for backwards compatibility with AsciiDoc.py
1122
1122
  content = content.slice 1, content.length - 2 if type == :latexmath && (content.start_with? '$') && (content.end_with? '$')
1123
1123
  subs = subs ? (resolve_pass_subs subs) : ((@document.basebackend? 'html') ? BASIC_SUBS : nil)
1124
1124
  passthrus[passthru_key = passthrus.size] = { text: content, subs: subs, type: type }
@@ -1232,17 +1232,16 @@ module Substitutors
1232
1232
  resolve_subs subs, :inline, nil, 'passthrough macro'
1233
1233
  end
1234
1234
 
1235
- # Public: Expand all groups in the subs list and return. If no subs are resolve, return nil.
1235
+ # Public: Expand all groups in the subs list and return. If no subs are resolved, return nil.
1236
1236
  #
1237
- # subs - The substitutions to expand; can be a Symbol, Symbol Array or nil
1237
+ # subs - The substitutions to expand; can be a Symbol, Symbol Array, or String
1238
+ # subject - The String to use in log messages to communicate the subject for which subs are being resolved (default: nil)
1238
1239
  #
1239
1240
  # Returns a Symbol Array of substitutions to pass to apply_subs or nil if no substitutions were resolved.
1240
- def expand_subs subs
1241
+ def expand_subs subs, subject = nil
1241
1242
  if ::Symbol === subs
1242
- unless subs == :none
1243
- SUB_GROUPS[subs] || [subs]
1244
- end
1245
- else
1243
+ subs == :none ? nil : SUB_GROUPS[subs] || [subs]
1244
+ elsif ::Array === subs
1246
1245
  expanded_subs = []
1247
1246
  subs.each do |key|
1248
1247
  unless key == :none
@@ -1253,8 +1252,9 @@ module Substitutors
1253
1252
  end
1254
1253
  end
1255
1254
  end
1256
-
1257
1255
  expanded_subs.empty? ? nil : expanded_subs
1256
+ else
1257
+ resolve_subs subs, :inline, nil, subject
1258
1258
  end
1259
1259
  end
1260
1260
 
@@ -1276,7 +1276,7 @@ module Substitutors
1276
1276
  # NOTE :literal with listparagraph-option gets folded into text of list item later
1277
1277
  default_subs = @context == :verse ? NORMAL_SUBS : VERBATIM_SUBS
1278
1278
  when :raw
1279
- # TODO make pass subs a compliance setting; AsciiDoc Python performs :attributes and :macros on a pass block
1279
+ # TODO make pass subs a compliance setting; AsciiDoc.py performs :attributes and :macros on a pass block
1280
1280
  default_subs = @context == :stem ? BASIC_SUBS : NO_SUBS
1281
1281
  else
1282
1282
  return @subs
@@ -33,13 +33,13 @@ class SyntaxHighlighter::PygmentsAdapter < SyntaxHighlighter::Base
33
33
  highlighted = highlighted.sub WrapperTagRx, PreTagCs
34
34
  opts[:callouts] ? [highlighted, (idx = highlighted.index CodeCellStartTagCs) ? idx + CodeCellStartTagCs.length : nil] : highlighted
35
35
  else
36
- node.sub_specialchars source # handles nil response from ::Pygments::Lexer#highlight
36
+ node.sub_source source, false # handles nil response from ::Pygments::Lexer#highlight
37
37
  end
38
38
  elsif (highlighted = lexer.highlight source, options: highlight_opts)
39
39
  highlighted = highlighted.gsub StyledLinenoSpanTagRx, LinenoSpanTagCs if linenos && noclasses
40
40
  highlighted.sub WrapperTagRx, '\1'
41
41
  else
42
- node.sub_specialchars source # handles nil response from ::Pygments::Lexer#highlight
42
+ node.sub_source source, false # handles nil response from ::Pygments::Lexer#highlight
43
43
  end
44
44
  end
45
45
 
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Asciidoctor
3
- VERSION = '2.0.13'
3
+ VERSION = '2.0.14'
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, Ryan Waldron
4
- .\" Generator: Asciidoctor 2.0.13
5
- .\" Date: 2021-04-10
4
+ .\" Generator: Asciidoctor 2.0.14
5
+ .\" Date: 2021-04-19
6
6
  .\" Manual: Asciidoctor Manual
7
- .\" Source: Asciidoctor 2.0.13
7
+ .\" Source: Asciidoctor 2.0.14
8
8
  .\" Language: English
9
9
  .\"
10
- .TH "ASCIIDOCTOR" "1" "2021-04-10" "Asciidoctor 2.0.13" "Asciidoctor Manual"
10
+ .TH "ASCIIDOCTOR" "1" "2021-04-19" "Asciidoctor 2.0.14" "Asciidoctor Manual"
11
11
  .ie \n(.g .ds Aq \(aq
12
12
  .el .ds Aq '
13
13
  .ss \n[.ss] 0
data/man/asciidoctor.adoc CHANGED
@@ -1,7 +1,7 @@
1
1
  = asciidoctor(1)
2
2
  Dan Allen; Sarah White; Ryan Waldron
3
3
  :doctype: manpage
4
- :release-version: 2.0.13
4
+ :release-version: 2.0.14
5
5
  :man manual: Asciidoctor Manual
6
6
  :man source: Asciidoctor {release-version}
7
7
  :page-layout: base
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.13
4
+ version: 2.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Allen
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2021-04-10 00:00:00.000000000 Z
16
+ date: 2021-04-19 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: asciimath