asciidoctor 2.0.23 → 2.0.25
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 +4 -4
 - data/CHANGELOG.adoc +54 -1
 - data/README-de.adoc +2 -2
 - data/README-fr.adoc +2 -2
 - data/README-jp.adoc +2 -2
 - data/README-zh_CN.adoc +2 -2
 - data/README.adoc +2 -2
 - data/asciidoctor.gemspec +3 -2
 - data/data/locale/attributes-pt_BR.adoc +1 -1
 - data/data/stylesheets/asciidoctor-default.css +1 -1
 - data/lib/asciidoctor/abstract_node.rb +1 -9
 - data/lib/asciidoctor/callouts.rb +1 -1
 - data/lib/asciidoctor/cli/options.rb +1 -1
 - data/lib/asciidoctor/converter/docbook5.rb +5 -2
 - data/lib/asciidoctor/converter/html5.rb +6 -1
 - data/lib/asciidoctor/converter.rb +2 -2
 - data/lib/asciidoctor/document.rb +2 -2
 - data/lib/asciidoctor/extensions.rb +10 -17
 - data/lib/asciidoctor/helpers.rb +20 -0
 - data/lib/asciidoctor/logging.rb +16 -5
 - data/lib/asciidoctor/parser.rb +3 -3
 - data/lib/asciidoctor/reader.rb +34 -26
 - data/lib/asciidoctor/rx.rb +2 -2
 - data/lib/asciidoctor/substitutors.rb +6 -6
 - data/lib/asciidoctor/syntax_highlighter/coderay.rb +3 -2
 - data/lib/asciidoctor/version.rb +1 -1
 - data/man/asciidoctor.1 +3 -3
 - data/man/asciidoctor.adoc +1 -1
 - metadata +8 -7
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 15bd78ac6106922b76adf86234dbee3e2c477401dbd69f011bea808166cadbca
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 22dc236b8852541f241b8076c7bd0427ed768c4a82acebaff35ebb37c3e47fec
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 274206a482d52d7e6fa7be668de7953ed3d137c200a861487d3be3252a868bb780f1eb36345247d706f9bfdbf6644902d5a48a345dc2f6dfc7bfcfd9eb1be851
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: aa4831bbfc906f8605757b93e6ec3cdea9919b3d8f15d737962066a9a3356ad268bb67335c4e91866b10a960f03d21aa506d10e8b08a44f2ad1e54cea1e9e3b0
         
     | 
    
        data/CHANGELOG.adoc
    CHANGED
    
    | 
         @@ -16,6 +16,60 @@ For an even more detailed look at what has changed, refer to the {url-repo}/comm 
     | 
|
| 
       16 
16 
     | 
    
         
             
            This project utilizes semantic versioning.
         
     | 
| 
       17 
17 
     | 
    
         | 
| 
       18 
18 
     | 
    
         
             
            // tag::compact[]
         
     | 
| 
      
 19 
     | 
    
         
            +
            == 2.0.25 (2025-10-16) - @mojavelinux
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
            Improvements::
         
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
      
 23 
     | 
    
         
            +
              * Don't freeze processor instance of extension to allow use of instance variables (#4782)
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
            Bug Fixes::
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
              * Fix false positive when looking for custom block macro, leading to superfluous debug message (#4785)
         
     | 
| 
      
 28 
     | 
    
         
            +
              * Start sectlink after any supplemental anchors on section title when sectlinks is set (#2934)
         
     | 
| 
      
 29 
     | 
    
         
            +
              * Remove trailing space after reftext in inline anchor shorthand (to accomodate trailing `]` in reftext) (#4789)
         
     | 
| 
      
 30 
     | 
    
         
            +
             
     | 
| 
      
 31 
     | 
    
         
            +
            === Details
         
     | 
| 
      
 32 
     | 
    
         
            +
             
     | 
| 
      
 33 
     | 
    
         
            +
            {url-repo}/releases/tag/v2.0.25[git tag] | {url-repo}/compare/v2.0.24\...v2.0.25[full diff]
         
     | 
| 
      
 34 
     | 
    
         
            +
            // end::compact[]
         
     | 
| 
      
 35 
     | 
    
         
            +
             
     | 
| 
      
 36 
     | 
    
         
            +
            == 2.0.24 (2025-10-13) - @mojavelinux
         
     | 
| 
      
 37 
     | 
    
         
            +
             
     | 
| 
      
 38 
     | 
    
         
            +
            Compliance::
         
     | 
| 
      
 39 
     | 
    
         
            +
             
     | 
| 
      
 40 
     | 
    
         
            +
              * Support link attribute on inline image macro when converting to DocBook (#4385)
         
     | 
| 
      
 41 
     | 
    
         
            +
              * Add magic comment `backticks_javascript: true` to achieve compatibility with Opal 2.0 (#4775) (*@janbiedermann*)
         
     | 
| 
      
 42 
     | 
    
         
            +
              * Extract the require logic of the OpenURI library for Asciidoctor.js compatibility (#4244) (*@ggrossetie*)
         
     | 
| 
      
 43 
     | 
    
         
            +
             
     | 
| 
      
 44 
     | 
    
         
            +
            Improvements::
         
     | 
| 
      
 45 
     | 
    
         
            +
             
     | 
| 
      
 46 
     | 
    
         
            +
              * Suppress warning about loading logger from stdlib when using Ruby 3.4 (#4769)
         
     | 
| 
      
 47 
     | 
    
         
            +
              * Log error if unterminated preprocessor conditional directive is detected (#3545)
         
     | 
| 
      
 48 
     | 
    
         
            +
              * Coerce names passed to the `positional_attrs` directive on an extension to strings (#4674)
         
     | 
| 
      
 49 
     | 
    
         
            +
              * Ignore `SOURCE_DATE_EPOCH` environment variable if value is empty instead of exiting with non-zero exit code (#4631)
         
     | 
| 
      
 50 
     | 
    
         
            +
              * Change Brazilian Portuguese translation for toc-title (#4653) (*@giflw*)
         
     | 
| 
      
 51 
     | 
    
         
            +
             
     | 
| 
      
 52 
     | 
    
         
            +
            Bug Fixes::
         
     | 
| 
      
 53 
     | 
    
         
            +
             
     | 
| 
      
 54 
     | 
    
         
            +
              * Consider `convert_` prefix when looking for missing convert method in converter (#4669) (*@eugoka*)
         
     | 
| 
      
 55 
     | 
    
         
            +
              * Pass kwargs to Logger superclass and only assign defaults when kwarg is not specified (#4773)
         
     | 
| 
      
 56 
     | 
    
         
            +
              * Set logdev to $stderr if no arguments are passed to Logger constructor (#4250)
         
     | 
| 
      
 57 
     | 
    
         
            +
              * Don't push conditional onto stack if conditional preprocessor directive is invalid when skipping lines (#4603)
         
     | 
| 
      
 58 
     | 
    
         
            +
              * Only style code tag as block element when inside pre in listing block; not inside verse block (#4610)
         
     | 
| 
      
 59 
     | 
    
         
            +
              * Don't add role=include to link macro that replaces include directive when running in compat mode (#4608)
         
     | 
| 
      
 60 
     | 
    
         
            +
             
     | 
| 
      
 61 
     | 
    
         
            +
            Documentation::
         
     | 
| 
      
 62 
     | 
    
         
            +
             
     | 
| 
      
 63 
     | 
    
         
            +
              * Rewrite documentation for how to create a custom converter from scratch and make examples more thorough (#4699)
         
     | 
| 
      
 64 
     | 
    
         
            +
             
     | 
| 
      
 65 
     | 
    
         
            +
            Build / Infrastructure::
         
     | 
| 
      
 66 
     | 
    
         
            +
             
     | 
| 
      
 67 
     | 
    
         
            +
              * Fix classification of several substitution tests (#4691) (*@scouten*)
         
     | 
| 
      
 68 
     | 
    
         
            +
             
     | 
| 
      
 69 
     | 
    
         
            +
            === Details
         
     | 
| 
      
 70 
     | 
    
         
            +
             
     | 
| 
      
 71 
     | 
    
         
            +
            {url-repo}/releases/tag/v2.0.24[git tag] | {url-repo}/compare/v2.0.23\...v2.0.24[full diff]
         
     | 
| 
      
 72 
     | 
    
         
            +
             
     | 
| 
       19 
73 
     | 
    
         
             
            == 2.0.23 (2024-05-17) - @mojavelinux
         
     | 
| 
       20 
74 
     | 
    
         | 
| 
       21 
75 
     | 
    
         
             
            Compliance::
         
     | 
| 
         @@ -38,7 +92,6 @@ Bug Fixes:: 
     | 
|
| 
       38 
92 
     | 
    
         
             
            === Details
         
     | 
| 
       39 
93 
     | 
    
         | 
| 
       40 
94 
     | 
    
         
             
            {url-repo}/releases/tag/v2.0.23[git tag] | {url-repo}/compare/v2.0.22\...v2.0.23[full diff]
         
     | 
| 
       41 
     | 
    
         
            -
            // end::compact[]
         
     | 
| 
       42 
95 
     | 
    
         | 
| 
       43 
96 
     | 
    
         
             
            == 2.0.22 (2024-03-08) - @mojavelinux
         
     | 
| 
       44 
97 
     | 
    
         | 
    
        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]>
         
     | 
| 
       3 
     | 
    
         
            -
            v2.0. 
     | 
| 
      
 3 
     | 
    
         
            +
            v2.0.25, 2025-10-16
         
     | 
| 
       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. 
     | 
| 
      
 19 
     | 
    
         
            +
            :release-version: 2.0.25
         
     | 
| 
       20 
20 
     | 
    
         
             
            // URIs:
         
     | 
| 
       21 
21 
     | 
    
         
             
            :uri-org: https://github.com/asciidoctor
         
     | 
| 
       22 
22 
     | 
    
         
             
            :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]>
         
     | 
| 
       3 
     | 
    
         
            -
            v2.0. 
     | 
| 
      
 3 
     | 
    
         
            +
            v2.0.25, 2025-10-16
         
     | 
| 
       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. 
     | 
| 
      
 19 
     | 
    
         
            +
            :release-version: 2.0.25
         
     | 
| 
       20 
20 
     | 
    
         
             
            // URIs:
         
     | 
| 
       21 
21 
     | 
    
         
             
            :uri-org: https://github.com/asciidoctor
         
     | 
| 
       22 
22 
     | 
    
         
             
            :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]>
         
     | 
| 
       3 
     | 
    
         
            -
            v2.0. 
     | 
| 
      
 3 
     | 
    
         
            +
            v2.0.25, 2025-10-16
         
     | 
| 
       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. 
     | 
| 
      
 19 
     | 
    
         
            +
            :release-version: 2.0.25
         
     | 
| 
       20 
20 
     | 
    
         
             
            // URIs:
         
     | 
| 
       21 
21 
     | 
    
         
             
            :uri-org: https://github.com/asciidoctor
         
     | 
| 
       22 
22 
     | 
    
         
             
            :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]>
         
     | 
| 
       3 
     | 
    
         
            -
            v2.0. 
     | 
| 
      
 3 
     | 
    
         
            +
            v2.0.25, 2025-10-16
         
     | 
| 
       4 
4 
     | 
    
         
             
            // settings:
         
     | 
| 
       5 
5 
     | 
    
         
             
            :page-layout: base
         
     | 
| 
       6 
6 
     | 
    
         
             
            :idprefix:
         
     | 
| 
         @@ -17,7 +17,7 @@ ifdef::env-github[] 
     | 
|
| 
       17 
17 
     | 
    
         
             
            :warning-caption: :warning:
         
     | 
| 
       18 
18 
     | 
    
         
             
            endif::[]
         
     | 
| 
       19 
19 
     | 
    
         
             
            // Variables:
         
     | 
| 
       20 
     | 
    
         
            -
            :release-version: 2.0. 
     | 
| 
      
 20 
     | 
    
         
            +
            :release-version: 2.0.25
         
     | 
| 
       21 
21 
     | 
    
         
             
            // URIs:
         
     | 
| 
       22 
22 
     | 
    
         
             
            :uri-org: https://github.com/asciidoctor
         
     | 
| 
       23 
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. 
     | 
| 
      
 3 
     | 
    
         
            +
            v2.0.25, 2025-10-16
         
     | 
| 
       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. 
     | 
| 
      
 19 
     | 
    
         
            +
            :release-version: 2.0.25
         
     | 
| 
       20 
20 
     | 
    
         
             
            // URLs:
         
     | 
| 
       21 
21 
     | 
    
         
             
            :url-org: https://github.com/asciidoctor
         
     | 
| 
       22 
22 
     | 
    
         
             
            :url-repo: {url-org}/asciidoctor
         
     | 
    
        data/asciidoctor.gemspec
    CHANGED
    
    | 
         @@ -19,7 +19,8 @@ Gem::Specification.new do |s| 
     | 
|
| 
       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 
21 
     | 
    
         
             
                'mailing_list_uri' => 'https://chat.asciidoctor.org',
         
     | 
| 
       22 
     | 
    
         
            -
                'source_code_uri' => 'https://github.com/asciidoctor/asciidoctor'
         
     | 
| 
      
 22 
     | 
    
         
            +
                'source_code_uri' => 'https://github.com/asciidoctor/asciidoctor',
         
     | 
| 
      
 23 
     | 
    
         
            +
                'funding_uri' => 'https://opencollective.com/asciidoctor'
         
     | 
| 
       23 
24 
     | 
    
         
             
              }
         
     | 
| 
       24 
25 
     | 
    
         | 
| 
       25 
26 
     | 
    
         
             
              # NOTE the logic to build the list of files is designed to produce a usable package even when the git command is not available
         
     | 
| 
         @@ -38,7 +39,7 @@ Gem::Specification.new do |s| 
     | 
|
| 
       38 
39 
     | 
    
         
             
              s.add_development_dependency 'cucumber', '~> 3.1.0'
         
     | 
| 
       39 
40 
     | 
    
         
             
              # erubi is needed for testing alternate eRuby impls
         
     | 
| 
       40 
41 
     | 
    
         
             
              s.add_development_dependency 'erubi', '~> 1.10.0'
         
     | 
| 
       41 
     | 
    
         
            -
              s.add_development_dependency 'haml', '~> 6. 
     | 
| 
      
 42 
     | 
    
         
            +
              s.add_development_dependency 'haml', '~> 6.3.0'
         
     | 
| 
       42 
43 
     | 
    
         
             
              s.add_development_dependency 'minitest', '~> 5.22.0'
         
     | 
| 
       43 
44 
     | 
    
         
             
              s.add_development_dependency 'nokogiri', '~> 1.13.0'
         
     | 
| 
       44 
45 
     | 
    
         
             
              s.add_development_dependency 'rake', '~> 12.3.0'
         
     | 
| 
         @@ -106,7 +106,6 @@ h1 strong,h2 strong,h3 strong,#toctitle strong,.sidebarblock>.content>.title str 
     | 
|
| 
       106 
106 
     | 
    
         
             
            :not(pre):not([class^=L])>code{font-size:.9375em;font-style:normal!important;letter-spacing:0;padding:.1em .5ex;word-spacing:-.15em;background:#f7f7f8;border-radius:4px;line-height:1.45;text-rendering:optimizeSpeed}
         
     | 
| 
       107 
107 
     | 
    
         
             
            pre{color:rgba(0,0,0,.9);font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;line-height:1.45;text-rendering:optimizeSpeed}
         
     | 
| 
       108 
108 
     | 
    
         
             
            pre code,pre pre{color:inherit;font-size:inherit;line-height:inherit}
         
     | 
| 
       109 
     | 
    
         
            -
            pre>code{display:block}
         
     | 
| 
       110 
109 
     | 
    
         
             
            pre.nowrap,pre.nowrap pre{white-space:pre;word-wrap:normal}
         
     | 
| 
       111 
110 
     | 
    
         
             
            em em{font-style:normal}
         
     | 
| 
       112 
111 
     | 
    
         
             
            strong strong{font-weight:400}
         
     | 
| 
         @@ -209,6 +208,7 @@ table.tableblock.fit-content>caption.title{white-space:nowrap;width:0} 
     | 
|
| 
       209 
208 
     | 
    
         
             
            .literalblock pre,.listingblock>.content>pre:not(.highlight),.listingblock>.content>pre[class=highlight],.listingblock>.content>pre[class^="highlight "]{background:#f7f7f8}
         
     | 
| 
       210 
209 
     | 
    
         
             
            .literalblock.output pre{color:#f7f7f8;background:rgba(0,0,0,.9)}
         
     | 
| 
       211 
210 
     | 
    
         
             
            .listingblock>.content{position:relative}
         
     | 
| 
      
 211 
     | 
    
         
            +
            .listingblock pre>code{display:block}
         
     | 
| 
       212 
212 
     | 
    
         
             
            .listingblock code[data-lang]::before{display:none;content:attr(data-lang);position:absolute;font-size:.75em;top:.425rem;right:.5rem;line-height:1;text-transform:uppercase;color:inherit;opacity:.5}
         
     | 
| 
       213 
213 
     | 
    
         
             
            .listingblock:hover code[data-lang]::before{display:block}
         
     | 
| 
       214 
214 
     | 
    
         
             
            .listingblock.terminal pre .command::before{content:attr(data-prompt);padding-right:.5em;color:inherit;opacity:.5}
         
     | 
| 
         @@ -399,15 +399,7 @@ class AbstractNode 
     | 
|
| 
       399 
399 
     | 
    
         
             
              # Returns A data URI string built from Base64 encoded data read from the URI
         
     | 
| 
       400 
400 
     | 
    
         
             
              # and the mime type specified in the Content Type header.
         
     | 
| 
       401 
401 
     | 
    
         
             
              def generate_data_uri_from_uri image_uri, cache_uri = false
         
     | 
| 
       402 
     | 
    
         
            -
                 
     | 
| 
       403 
     | 
    
         
            -
                  # caching requires the open-uri-cached gem to be installed
         
     | 
| 
       404 
     | 
    
         
            -
                  # processing will be automatically aborted if these libraries can't be opened
         
     | 
| 
       405 
     | 
    
         
            -
                  Helpers.require_library 'open-uri/cached', 'open-uri-cached'
         
     | 
| 
       406 
     | 
    
         
            -
                elsif !RUBY_ENGINE_OPAL
         
     | 
| 
       407 
     | 
    
         
            -
                  # autoload open-uri
         
     | 
| 
       408 
     | 
    
         
            -
                  ::OpenURI
         
     | 
| 
       409 
     | 
    
         
            -
                end
         
     | 
| 
       410 
     | 
    
         
            -
             
     | 
| 
      
 402 
     | 
    
         
            +
                Helpers.require_open_uri cache_uri
         
     | 
| 
       411 
403 
     | 
    
         
             
                begin
         
     | 
| 
       412 
404 
     | 
    
         
             
                  mimetype, bindata = ::OpenURI.open_uri(image_uri, URI_READ_MODE) {|f| [f.content_type, f.read] }
         
     | 
| 
       413 
405 
     | 
    
         
             
                  # NOTE pack 'm0' is equivalent to Base64.strict_encode64
         
     | 
    
        data/lib/asciidoctor/callouts.rb
    CHANGED
    
    | 
         @@ -59,7 +59,7 @@ class Callouts 
     | 
|
| 
       59 
59 
     | 
    
         
             
              #
         
     | 
| 
       60 
60 
     | 
    
         
             
              # Returns A space-separated String of callout ids associated with the specified list item
         
     | 
| 
       61 
61 
     | 
    
         
             
              def callout_ids li_ordinal
         
     | 
| 
       62 
     | 
    
         
            -
                current_list.map {| 
     | 
| 
      
 62 
     | 
    
         
            +
                current_list.map {|item| item[:ordinal] == li_ordinal ? %(#{item[:id]} ) : '' }.join.chop
         
     | 
| 
       63 
63 
     | 
    
         
             
              end
         
     | 
| 
       64 
64 
     | 
    
         | 
| 
       65 
65 
     | 
    
         
             
              # Public: The current list for which callouts are being collected
         
     | 
| 
         @@ -94,7 +94,7 @@ module Asciidoctor 
     | 
|
| 
       94 
94 
     | 
    
         
             
                        self[:attributes][name] = val
         
     | 
| 
       95 
95 
     | 
    
         
             
                      end
         
     | 
| 
       96 
96 
     | 
    
         
             
                      opts.on('-T', '--template-dir DIR', 'a directory containing custom converter templates that override the built-in converter (requires tilt gem)',
         
     | 
| 
       97 
     | 
    
         
            -
                          'may be specified  
     | 
| 
      
 97 
     | 
    
         
            +
                          'may be specified more than once') do |template_dir|
         
     | 
| 
       98 
98 
     | 
    
         
             
                        if self[:template_dirs].nil?
         
     | 
| 
       99 
99 
     | 
    
         
             
                          self[:template_dirs] = [template_dir]
         
     | 
| 
       100 
100 
     | 
    
         
             
                        elsif ::Array === self[:template_dirs]
         
     | 
| 
         @@ -535,12 +535,15 @@ class Converter::DocBook5Converter < Converter::Base 
     | 
|
| 
       535 
535 
     | 
    
         
             
              end
         
     | 
| 
       536 
536 
     | 
    
         | 
| 
       537 
537 
     | 
    
         
             
              def convert_inline_image node
         
     | 
| 
       538 
     | 
    
         
            -
                %(<inlinemediaobject#{common_attributes nil, node.role}>
         
     | 
| 
      
 538 
     | 
    
         
            +
                img = %(<inlinemediaobject#{common_attributes nil, node.role}>
         
     | 
| 
       539 
539 
     | 
    
         
             
            <imageobject>
         
     | 
| 
       540 
     | 
    
         
            -
            <imagedata fileref="#{node.type == 'icon' ? (node.icon_uri node.target) : (node.image_uri node.target)}"#{image_size_attributes node.attributes}/>
         
     | 
| 
      
 540 
     | 
    
         
            +
            <imagedata fileref="#{node.type == 'icon' ? (node.icon_uri node.target) : (fileref = node.image_uri node.target)}"#{image_size_attributes node.attributes}/>
         
     | 
| 
       541 
541 
     | 
    
         
             
            </imageobject>
         
     | 
| 
       542 
542 
     | 
    
         
             
            <textobject><phrase>#{node.alt}</phrase></textobject>
         
     | 
| 
       543 
543 
     | 
    
         
             
            </inlinemediaobject>)
         
     | 
| 
      
 544 
     | 
    
         
            +
                fileref && (node.attr? 'link') && (link_href = node.attr 'link') ?
         
     | 
| 
      
 545 
     | 
    
         
            +
                  %(<link xl:href="#{link_href}">#{img}</link>) :
         
     | 
| 
      
 546 
     | 
    
         
            +
                  img
         
     | 
| 
       544 
547 
     | 
    
         
             
              end
         
     | 
| 
       545 
548 
     | 
    
         | 
| 
       546 
549 
     | 
    
         
             
              def convert_inline_indexterm node
         
     | 
| 
         @@ -22,6 +22,7 @@ class Converter::Html5Converter < Converter::Base 
     | 
|
| 
       22 
22 
     | 
    
         
             
              }).default = ['', '']
         
     | 
| 
       23 
23 
     | 
    
         | 
| 
       24 
24 
     | 
    
         
             
              DropAnchorRx = %r(<(?:a\b[^>]*|/a)>)
         
     | 
| 
      
 25 
     | 
    
         
            +
              LeadingAnchorsRx = %r(^(?:<a id="[^"]+"></a>)+)
         
     | 
| 
       25 
26 
     | 
    
         
             
              StemBreakRx = / *\\\n(?:\\?\n)*|\n\n+/
         
     | 
| 
       26 
27 
     | 
    
         
             
              if RUBY_ENGINE == 'opal'
         
     | 
| 
       27 
28 
     | 
    
         
             
                # NOTE In JavaScript, ^ matches the start of the string when the m flag is not set
         
     | 
| 
         @@ -402,7 +403,11 @@ MathJax.Hub.Register.StartupHook("AsciiMath Jax Ready", function () { 
     | 
|
| 
       402 
403 
     | 
    
         
             
                if node.id
         
     | 
| 
       403 
404 
     | 
    
         
             
                  id_attr = %( id="#{id = node.id}")
         
     | 
| 
       404 
405 
     | 
    
         
             
                  if doc_attrs['sectlinks']
         
     | 
| 
       405 
     | 
    
         
            -
                    title  
     | 
| 
      
 406 
     | 
    
         
            +
                    if (title.start_with? '<a ') && LeadingAnchorsRx =~ title
         
     | 
| 
      
 407 
     | 
    
         
            +
                      title = %(#{$&}<a class="link" href="##{id}">#{title.slice $&.length, title.length}</a>)
         
     | 
| 
      
 408 
     | 
    
         
            +
                    else
         
     | 
| 
      
 409 
     | 
    
         
            +
                      title = %(<a class="link" href="##{id}">#{title}</a>)
         
     | 
| 
      
 410 
     | 
    
         
            +
                    end
         
     | 
| 
       406 
411 
     | 
    
         
             
                  end
         
     | 
| 
       407 
412 
     | 
    
         
             
                  if doc_attrs['sectanchors']
         
     | 
| 
       408 
413 
     | 
    
         
             
                    # QUESTION should we add a font-based icon in anchor if icons=font?
         
     | 
| 
         @@ -390,8 +390,8 @@ module Converter 
     | 
|
| 
       390 
390 
     | 
    
         
             
                def convert node, transform = node.node_name, opts = nil
         
     | 
| 
       391 
391 
     | 
    
         
             
                  opts ? (send 'convert_' + transform, node, opts) : (send 'convert_' + transform, node)
         
     | 
| 
       392 
392 
     | 
    
         
             
                rescue
         
     | 
| 
       393 
     | 
    
         
            -
                  raise unless ::NoMethodError === (ex = $!) && ex.receiver == self && ex.name.to_s == transform
         
     | 
| 
       394 
     | 
    
         
            -
                  logger.warn %(missing convert handler for #{ 
     | 
| 
      
 393 
     | 
    
         
            +
                  raise unless ::NoMethodError === (ex = $!) && ex.receiver == self && ex.name.to_s == 'convert_' + transform
         
     | 
| 
      
 394 
     | 
    
         
            +
                  logger.warn %(missing convert handler for #{transform} node in #{@backend} backend (#{self.class}))
         
     | 
| 
       395 
395 
     | 
    
         
             
                  nil
         
     | 
| 
       396 
396 
     | 
    
         
             
                end
         
     | 
| 
       397 
397 
     | 
    
         | 
    
        data/lib/asciidoctor/document.rb
    CHANGED
    
    | 
         @@ -1038,7 +1038,7 @@ class Document < AbstractBlock 
     | 
|
| 
       1038 
1038 
     | 
    
         
             
                      docinfo = docinfo ? ['private'] : nil
         
     | 
| 
       1039 
1039 
     | 
    
         
             
                    end
         
     | 
| 
       1040 
1040 
     | 
    
         
             
                  else
         
     | 
| 
       1041 
     | 
    
         
            -
                    docinfo = docinfo.split(',').map {| 
     | 
| 
      
 1041 
     | 
    
         
            +
                    docinfo = docinfo.split(',').map {|keyword| keyword.strip }
         
     | 
| 
       1042 
1042 
     | 
    
         
             
                  end
         
     | 
| 
       1043 
1043 
     | 
    
         | 
| 
       1044 
1044 
     | 
    
         
             
                  if docinfo
         
     | 
| 
         @@ -1256,7 +1256,7 @@ class Document < AbstractBlock 
     | 
|
| 
       1256 
1256 
     | 
    
         
             
              # localdatetime, docdate, docyear, doctime, and docdatetime. Honor the SOURCE_DATE_EPOCH environment variable, if set.
         
     | 
| 
       1257 
1257 
     | 
    
         
             
              def fill_datetime_attributes attrs, input_mtime
         
     | 
| 
       1258 
1258 
     | 
    
         
             
                # See https://reproducible-builds.org/specs/source-date-epoch/
         
     | 
| 
       1259 
     | 
    
         
            -
                now =  
     | 
| 
      
 1259 
     | 
    
         
            +
                now = ::ENV['SOURCE_DATE_EPOCH'].nil_or_empty? ? ::Time.now : (source_date_epoch = (::Time.at Integer ::ENV['SOURCE_DATE_EPOCH']).utc)
         
     | 
| 
       1260 
1260 
     | 
    
         
             
                if (localdate = attrs['localdate'])
         
     | 
| 
       1261 
1261 
     | 
    
         
             
                  attrs['localyear'] ||= (localdate.index '-') == 4 ? (localdate.slice 0, 4) : nil
         
     | 
| 
       1262 
1262 
     | 
    
         
             
                else
         
     | 
| 
         @@ -309,7 +309,7 @@ module Extensions 
     | 
|
| 
       309 
309 
     | 
    
         
             
                alias parse_content_as content_model
         
     | 
| 
       310 
310 
     | 
    
         | 
| 
       311 
311 
     | 
    
         
             
                def positional_attributes *value
         
     | 
| 
       312 
     | 
    
         
            -
                  option :positional_attrs, value.flatten
         
     | 
| 
      
 312 
     | 
    
         
            +
                  option :positional_attrs, (value.flatten.map {|name| name.to_s })
         
     | 
| 
       313 
313 
     | 
    
         
             
                end
         
     | 
| 
       314 
314 
     | 
    
         
             
                alias name_positional_attributes positional_attributes
         
     | 
| 
       315 
315 
     | 
    
         
             
                # NOTE positional_attrs alias is deprecated
         
     | 
| 
         @@ -485,7 +485,7 @@ module Extensions 
     | 
|
| 
       485 
485 
     | 
    
         
             
              # to add content to the header.
         
     | 
| 
       486 
486 
     | 
    
         
             
              class DocinfoProcessor < Processor
         
     | 
| 
       487 
487 
     | 
    
         
             
                def initialize config = {}
         
     | 
| 
       488 
     | 
    
         
            -
                  super 
     | 
| 
      
 488 
     | 
    
         
            +
                  super
         
     | 
| 
       489 
489 
     | 
    
         
             
                  @config[:location] ||= :head
         
     | 
| 
       490 
490 
     | 
    
         
             
                end
         
     | 
| 
       491 
491 
     | 
    
         | 
| 
         @@ -1359,7 +1359,7 @@ module Extensions 
     | 
|
| 
       1359 
1359 
     | 
    
         | 
| 
       1360 
1360 
     | 
    
         
             
                def add_document_processor kind, args, &block
         
     | 
| 
       1361 
1361 
     | 
    
         
             
                  kind_name = kind.to_s.tr '_', ' '
         
     | 
| 
       1362 
     | 
    
         
            -
                  kind_class_symbol = kind_name.split.map {| 
     | 
| 
      
 1362 
     | 
    
         
            +
                  kind_class_symbol = kind_name.split.map {|segment| segment.capitalize }.join.to_sym
         
     | 
| 
       1363 
1363 
     | 
    
         
             
                  kind_class = Extensions.const_get kind_class_symbol, false
         
     | 
| 
       1364 
1364 
     | 
    
         
             
                  kind_java_class = (defined? ::AsciidoctorJ) ? (::AsciidoctorJ::Extensions.const_get kind_class_symbol, false) : nil
         
     | 
| 
       1365 
1365 
     | 
    
         
             
                  kind_store = instance_variable_get(%(@#{kind}_extensions).to_sym) || instance_variable_set(%(@#{kind}_extensions).to_sym, [])
         
     | 
| 
         @@ -1375,8 +1375,7 @@ module Extensions 
     | 
|
| 
       1375 
1375 
     | 
    
         
             
                    unless processor.process_block_given?
         
     | 
| 
       1376 
1376 
     | 
    
         
             
                      raise ::NoMethodError, %(No block specified to process #{kind_name} extension at #{block.source_location.join ':'})
         
     | 
| 
       1377 
1377 
     | 
    
         
             
                    end
         
     | 
| 
       1378 
     | 
    
         
            -
                    processor 
     | 
| 
       1379 
     | 
    
         
            -
                    extension = ProcessorExtension.new kind, processor
         
     | 
| 
      
 1378 
     | 
    
         
            +
                    processor_instance = processor
         
     | 
| 
       1380 
1379 
     | 
    
         
             
                  else
         
     | 
| 
       1381 
1380 
     | 
    
         
             
                    processor, config = resolve_args args, 2
         
     | 
| 
       1382 
1381 
     | 
    
         
             
                    # style 2: specified as Class or String class name
         
     | 
| 
         @@ -1385,25 +1384,22 @@ module Extensions 
     | 
|
| 
       1385 
1384 
     | 
    
         
             
                        raise ::ArgumentError, %(Invalid type for #{kind_name} extension: #{processor})
         
     | 
| 
       1386 
1385 
     | 
    
         
             
                      end
         
     | 
| 
       1387 
1386 
     | 
    
         
             
                      processor_instance = processor_class.new config
         
     | 
| 
       1388 
     | 
    
         
            -
                      processor_instance.freeze
         
     | 
| 
       1389 
     | 
    
         
            -
                      extension = ProcessorExtension.new kind, processor_instance
         
     | 
| 
       1390 
1387 
     | 
    
         
             
                    # style 3: specified as instance
         
     | 
| 
       1391 
1388 
     | 
    
         
             
                    elsif kind_class === processor || (kind_java_class && kind_java_class === processor)
         
     | 
| 
       1392 
1389 
     | 
    
         
             
                      processor.update_config config
         
     | 
| 
       1393 
     | 
    
         
            -
                      processor 
     | 
| 
       1394 
     | 
    
         
            -
                      extension = ProcessorExtension.new kind, processor
         
     | 
| 
      
 1390 
     | 
    
         
            +
                      processor_instance = processor
         
     | 
| 
       1395 
1391 
     | 
    
         
             
                    else
         
     | 
| 
       1396 
1392 
     | 
    
         
             
                      raise ::ArgumentError, %(Invalid arguments specified for registering #{kind_name} extension: #{args})
         
     | 
| 
       1397 
1393 
     | 
    
         
             
                    end
         
     | 
| 
       1398 
1394 
     | 
    
         
             
                  end
         
     | 
| 
       1399 
     | 
    
         
            -
             
     | 
| 
      
 1395 
     | 
    
         
            +
                  extension = ProcessorExtension.new kind, processor_instance
         
     | 
| 
       1400 
1396 
     | 
    
         
             
                  extension.config[:position] == :>> ? (kind_store.unshift extension) : (kind_store << extension)
         
     | 
| 
       1401 
1397 
     | 
    
         
             
                  extension
         
     | 
| 
       1402 
1398 
     | 
    
         
             
                end
         
     | 
| 
       1403 
1399 
     | 
    
         | 
| 
       1404 
1400 
     | 
    
         
             
                def add_syntax_processor kind, args, &block
         
     | 
| 
       1405 
1401 
     | 
    
         
             
                  kind_name = kind.to_s.tr '_', ' '
         
     | 
| 
       1406 
     | 
    
         
            -
                  kind_class_symbol = (kind_name.split.map {| 
     | 
| 
      
 1402 
     | 
    
         
            +
                  kind_class_symbol = (kind_name.split.map {|segment| segment.capitalize } << 'Processor').join.to_sym
         
     | 
| 
       1407 
1403 
     | 
    
         
             
                  kind_class = Extensions.const_get kind_class_symbol, false
         
     | 
| 
       1408 
1404 
     | 
    
         
             
                  kind_java_class = (defined? ::AsciidoctorJ) ? (::AsciidoctorJ::Extensions.const_get kind_class_symbol, false) : nil
         
     | 
| 
       1409 
1405 
     | 
    
         
             
                  kind_store = instance_variable_get(%(@#{kind}_extensions).to_sym) || instance_variable_set(%(@#{kind}_extensions).to_sym, {})
         
     | 
| 
         @@ -1422,8 +1418,7 @@ module Extensions 
     | 
|
| 
       1422 
1418 
     | 
    
         
             
                    unless processor.process_block_given?
         
     | 
| 
       1423 
1419 
     | 
    
         
             
                      raise ::NoMethodError, %(No block specified to process #{kind_name} extension at #{block.source_location.join ':'})
         
     | 
| 
       1424 
1420 
     | 
    
         
             
                    end
         
     | 
| 
       1425 
     | 
    
         
            -
                    processor 
     | 
| 
       1426 
     | 
    
         
            -
                    kind_store[name] = ProcessorExtension.new kind, processor
         
     | 
| 
      
 1421 
     | 
    
         
            +
                    processor_instance = processor
         
     | 
| 
       1427 
1422 
     | 
    
         
             
                  else
         
     | 
| 
       1428 
1423 
     | 
    
         
             
                    processor, name, config = resolve_args args, 3
         
     | 
| 
       1429 
1424 
     | 
    
         
             
                    # style 2: specified as Class or String class name
         
     | 
| 
         @@ -1435,8 +1430,6 @@ module Extensions 
     | 
|
| 
       1435 
1430 
     | 
    
         
             
                      unless (name = as_symbol processor_instance.name)
         
     | 
| 
       1436 
1431 
     | 
    
         
             
                        raise ::ArgumentError, %(No name specified for #{kind_name} extension: #{processor})
         
     | 
| 
       1437 
1432 
     | 
    
         
             
                      end
         
     | 
| 
       1438 
     | 
    
         
            -
                      processor_instance.freeze
         
     | 
| 
       1439 
     | 
    
         
            -
                      kind_store[name] = ProcessorExtension.new kind, processor_instance
         
     | 
| 
       1440 
1433 
     | 
    
         
             
                    # style 3: specified as instance
         
     | 
| 
       1441 
1434 
     | 
    
         
             
                    elsif kind_class === processor || (kind_java_class && kind_java_class === processor)
         
     | 
| 
       1442 
1435 
     | 
    
         
             
                      processor.update_config config
         
     | 
| 
         @@ -1444,12 +1437,12 @@ module Extensions 
     | 
|
| 
       1444 
1437 
     | 
    
         
             
                      unless (name = name ? (processor.name = as_symbol name) : (as_symbol processor.name))
         
     | 
| 
       1445 
1438 
     | 
    
         
             
                        raise ::ArgumentError, %(No name specified for #{kind_name} extension: #{processor})
         
     | 
| 
       1446 
1439 
     | 
    
         
             
                      end
         
     | 
| 
       1447 
     | 
    
         
            -
                      processor 
     | 
| 
       1448 
     | 
    
         
            -
                      kind_store[name] = ProcessorExtension.new kind, processor
         
     | 
| 
      
 1440 
     | 
    
         
            +
                      processor_instance = processor
         
     | 
| 
       1449 
1441 
     | 
    
         
             
                    else
         
     | 
| 
       1450 
1442 
     | 
    
         
             
                      raise ::ArgumentError, %(Invalid arguments specified for registering #{kind_name} extension: #{args})
         
     | 
| 
       1451 
1443 
     | 
    
         
             
                    end
         
     | 
| 
       1452 
1444 
     | 
    
         
             
                  end
         
     | 
| 
      
 1445 
     | 
    
         
            +
                  kind_store[name] = ProcessorExtension.new kind, processor_instance
         
     | 
| 
       1453 
1446 
     | 
    
         
             
                end
         
     | 
| 
       1454 
1447 
     | 
    
         | 
| 
       1455 
1448 
     | 
    
         
             
                def reset
         
     | 
    
        data/lib/asciidoctor/helpers.rb
    CHANGED
    
    | 
         @@ -1,3 +1,4 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # backtick_javascript: true
         
     | 
| 
       1 
2 
     | 
    
         
             
            # frozen_string_literal: true
         
     | 
| 
       2 
3 
     | 
    
         
             
            module Asciidoctor
         
     | 
| 
       3 
4 
     | 
    
         
             
            # Internal: Except where noted, a module that contains internal helper functions.
         
     | 
| 
         @@ -48,6 +49,25 @@ module Helpers 
     | 
|
| 
       48 
49 
     | 
    
         
             
                nil
         
     | 
| 
       49 
50 
     | 
    
         
             
              end
         
     | 
| 
       50 
51 
     | 
    
         | 
| 
      
 52 
     | 
    
         
            +
              # Internal: Require the OpenURI library.
         
     | 
| 
      
 53 
     | 
    
         
            +
              #
         
     | 
| 
      
 54 
     | 
    
         
            +
              # Attempts to load `open-uri-cached` if the cache argument is true otherwise autoload `open-uri`.
         
     | 
| 
      
 55 
     | 
    
         
            +
              #
         
     | 
| 
      
 56 
     | 
    
         
            +
              # cache - A Boolean flag indicating whether to activate content cache URI
         
     | 
| 
      
 57 
     | 
    
         
            +
              #
         
     | 
| 
      
 58 
     | 
    
         
            +
              # Returns nothing
         
     | 
| 
      
 59 
     | 
    
         
            +
              def require_open_uri cache = false
         
     | 
| 
      
 60 
     | 
    
         
            +
                if cache
         
     | 
| 
      
 61 
     | 
    
         
            +
                  # caching requires the open-uri-cached gem to be installed
         
     | 
| 
      
 62 
     | 
    
         
            +
                  # processing will be automatically aborted if these libraries can't be opened
         
     | 
| 
      
 63 
     | 
    
         
            +
                  require_library 'open-uri/cached', 'open-uri-cached' unless defined? ::OpenURI::Cache
         
     | 
| 
      
 64 
     | 
    
         
            +
                else
         
     | 
| 
      
 65 
     | 
    
         
            +
                  # autoload open-uri
         
     | 
| 
      
 66 
     | 
    
         
            +
                  ::OpenURI
         
     | 
| 
      
 67 
     | 
    
         
            +
                end
         
     | 
| 
      
 68 
     | 
    
         
            +
                nil
         
     | 
| 
      
 69 
     | 
    
         
            +
              end
         
     | 
| 
      
 70 
     | 
    
         
            +
             
     | 
| 
       51 
71 
     | 
    
         
             
              # Internal: Prepare the source data Array for parsing.
         
     | 
| 
       52 
72 
     | 
    
         
             
              #
         
     | 
| 
       53 
73 
     | 
    
         
             
              # Encodes the data to UTF-8, if necessary, and removes any trailing
         
     | 
    
        data/lib/asciidoctor/logging.rb
    CHANGED
    
    | 
         @@ -1,15 +1,26 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            # frozen_string_literal: true
         
     | 
| 
       2 
     | 
    
         
            -
             
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            proc do
         
     | 
| 
      
 4 
     | 
    
         
            +
              old_verbose, $VERBOSE = $VERBOSE, nil
         
     | 
| 
      
 5 
     | 
    
         
            +
              require 'logger' # suppress warning in Ruby 3.4 about loading logger from stdlib
         
     | 
| 
      
 6 
     | 
    
         
            +
              $VERBOSE = old_verbose
         
     | 
| 
      
 7 
     | 
    
         
            +
            end.call
         
     | 
| 
       3 
8 
     | 
    
         | 
| 
       4 
9 
     | 
    
         
             
            module Asciidoctor
         
     | 
| 
       5 
10 
     | 
    
         
             
            class Logger < ::Logger
         
     | 
| 
       6 
11 
     | 
    
         
             
              attr_reader :max_severity
         
     | 
| 
       7 
12 
     | 
    
         | 
| 
       8 
     | 
    
         
            -
              def initialize *args
         
     | 
| 
      
 13 
     | 
    
         
            +
              def initialize *args, **opts
         
     | 
| 
      
 14 
     | 
    
         
            +
                opts[:progname] = 'asciidoctor'
         
     | 
| 
      
 15 
     | 
    
         
            +
                opts[:formatter] = BasicFormatter.new unless opts.key? :formatter
         
     | 
| 
      
 16 
     | 
    
         
            +
                opts[:level] = WARN unless opts.key? :level
         
     | 
| 
      
 17 
     | 
    
         
            +
                args = [$stderr] if args.empty?
         
     | 
| 
       9 
18 
     | 
    
         
             
                super
         
     | 
| 
       10 
     | 
    
         
            -
                 
     | 
| 
       11 
     | 
    
         
            -
             
     | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
      
 19 
     | 
    
         
            +
                if @progname.nil? && (method __method__).super_method.parameters.size == 3
         
     | 
| 
      
 20 
     | 
    
         
            +
                  @progname = opts[:progname]
         
     | 
| 
      
 21 
     | 
    
         
            +
                  @formatter = opts[:formatter]
         
     | 
| 
      
 22 
     | 
    
         
            +
                  @level = opts[:level]
         
     | 
| 
      
 23 
     | 
    
         
            +
                end
         
     | 
| 
       13 
24 
     | 
    
         
             
              end
         
     | 
| 
       14 
25 
     | 
    
         | 
| 
       15 
26 
     | 
    
         
             
              def add severity, message = nil, progname = nil
         
     | 
    
        data/lib/asciidoctor/parser.rb
    CHANGED
    
    | 
         @@ -644,8 +644,8 @@ class Parser 
     | 
|
| 
       644 
644 
     | 
    
         
             
                          block.parse_attributes $1, [], into: attributes if $1
         
     | 
| 
       645 
645 
     | 
    
         
             
                          break
         
     | 
| 
       646 
646 
     | 
    
         | 
| 
       647 
     | 
    
         
            -
                        elsif block_macro_extensions ?  
     | 
| 
       648 
     | 
    
         
            -
                            (extension = extensions.registered_for_block_macro? $1) || (report_unknown_block_macro = logger.debug?)) :
         
     | 
| 
      
 647 
     | 
    
         
            +
                        elsif block_macro_extensions ? CustomBlockMacroRx =~ this_line &&
         
     | 
| 
      
 648 
     | 
    
         
            +
                            ((extension = extensions.registered_for_block_macro? $1) || (report_unknown_block_macro = logger.debug?)) :
         
     | 
| 
       649 
649 
     | 
    
         
             
                            (logger.debug? && (report_unknown_block_macro = CustomBlockMacroRx =~ this_line))
         
     | 
| 
       650 
650 
     | 
    
         
             
                          if report_unknown_block_macro
         
     | 
| 
       651 
651 
     | 
    
         
             
                            logger.debug message_with_context %(unknown name for block macro: #{$1}), source_location: reader.cursor_at_mark
         
     | 
| 
         @@ -1898,7 +1898,7 @@ class Parser 
     | 
|
| 
       1898 
1898 
     | 
    
         
             
                          implicit_author_metadata[%(firstname_#{name_idx = idx + 1})],
         
     | 
| 
       1899 
1899 
     | 
    
         
             
                          implicit_author_metadata[%(middlename_#{name_idx})],
         
     | 
| 
       1900 
1900 
     | 
    
         
             
                          implicit_author_metadata[%(lastname_#{name_idx})]
         
     | 
| 
       1901 
     | 
    
         
            -
                        ].compact.map {| 
     | 
| 
      
 1901 
     | 
    
         
            +
                        ].compact.map {|name| name.tr ' ', '_' }.join ' '
         
     | 
| 
       1902 
1902 
     | 
    
         
             
                      end if sparse
         
     | 
| 
       1903 
1903 
     | 
    
         
             
                      # process as names only
         
     | 
| 
       1904 
1904 
     | 
    
         
             
                      author_metadata = process_authors authors, true, false
         
     | 
    
        data/lib/asciidoctor/reader.rb
    CHANGED
    
    | 
         @@ -467,7 +467,7 @@ class Reader 
     | 
|
| 
       467 
467 
     | 
    
         
             
                  if lines_to_restore.respond_to? :reverse
         
     | 
| 
       468 
468 
     | 
    
         
             
                    @lines.push(*lines_to_restore.reverse)
         
     | 
| 
       469 
469 
     | 
    
         
             
                  else
         
     | 
| 
       470 
     | 
    
         
            -
                    lines_to_restore.reverse_each {| 
     | 
| 
      
 470 
     | 
    
         
            +
                    lines_to_restore.reverse_each {|l| @lines.push l }
         
     | 
| 
       471 
471 
     | 
    
         
             
                  end
         
     | 
| 
       472 
472 
     | 
    
         
             
                  nil
         
     | 
| 
       473 
473 
     | 
    
         
             
                end
         
     | 
| 
         @@ -619,7 +619,7 @@ class PreprocessorReader < Reader 
     | 
|
| 
       619 
619 
     | 
    
         | 
| 
       620 
620 
     | 
    
         
             
              # Public: Initialize the PreprocessorReader object
         
     | 
| 
       621 
621 
     | 
    
         
             
              def initialize document, data = nil, cursor = nil, opts = {}
         
     | 
| 
       622 
     | 
    
         
            -
                @document = document
         
     | 
| 
      
 622 
     | 
    
         
            +
                @sourcemap = (@document = document).sourcemap
         
     | 
| 
       623 
623 
     | 
    
         
             
                super data, cursor, opts
         
     | 
| 
       624 
624 
     | 
    
         
             
                if (default_include_depth = (document.attributes['max-include-depth'] || 64).to_i) > 0
         
     | 
| 
       625 
625 
     | 
    
         
             
                  # track absolute max depth, current max depth for comparing to include stack size, and relative max depth for reporting
         
     | 
| 
         @@ -657,6 +657,11 @@ class PreprocessorReader < Reader 
     | 
|
| 
       657 
657 
     | 
    
         
             
                if (line = super)
         
     | 
| 
       658 
658 
     | 
    
         
             
                  line
         
     | 
| 
       659 
659 
     | 
    
         
             
                elsif @include_stack.empty?
         
     | 
| 
      
 660 
     | 
    
         
            +
                  end_cursor = nil
         
     | 
| 
      
 661 
     | 
    
         
            +
                  @conditional_stack.delete_if do |conditional|
         
     | 
| 
      
 662 
     | 
    
         
            +
                    logger.error message_with_context %(detected unterminated preprocessor conditional directive: #{conditional[:name]}::#{conditional[:target] || ''}[#{conditional[:expr] || ''}]), source_location: conditional[:source_location] || (end_cursor ||= cursor_at_prev_line)
         
     | 
| 
      
 663 
     | 
    
         
            +
                    true
         
     | 
| 
      
 664 
     | 
    
         
            +
                  end
         
     | 
| 
       660 
665 
     | 
    
         
             
                  nil
         
     | 
| 
       661 
666 
     | 
    
         
             
                else
         
     | 
| 
       662 
667 
     | 
    
         
             
                  pop_include
         
     | 
| 
         @@ -890,7 +895,7 @@ class PreprocessorReader < Reader 
     | 
|
| 
       890 
895 
     | 
    
         
             
              # preprocessing recursively until the next line of available content is
         
     | 
| 
       891 
896 
     | 
    
         
             
              # found.
         
     | 
| 
       892 
897 
     | 
    
         
             
              #
         
     | 
| 
       893 
     | 
    
         
            -
              #  
     | 
| 
      
 898 
     | 
    
         
            +
              # name      - The name of the conditional inclusion directive (ifdef, ifndef, ifeval, endif)
         
     | 
| 
       894 
899 
     | 
    
         
             
              # target    - The target, which is the name of one or more attributes that are
         
     | 
| 
       895 
900 
     | 
    
         
             
              #             used in the condition (blank in the case of the ifeval directive)
         
     | 
| 
       896 
901 
     | 
    
         
             
              # delimiter - The conditional delimiter for multiple attributes ('+' means all
         
     | 
| 
         @@ -901,27 +906,32 @@ class PreprocessorReader < Reader 
     | 
|
| 
       901 
906 
     | 
    
         
             
              #             ifndef directives, and for the conditional expression for the ifeval directive.
         
     | 
| 
       902 
907 
     | 
    
         
             
              #
         
     | 
| 
       903 
908 
     | 
    
         
             
              # Returns a Boolean indicating whether the cursor should be advanced
         
     | 
| 
       904 
     | 
    
         
            -
              def preprocess_conditional_directive  
     | 
| 
      
 909 
     | 
    
         
            +
              def preprocess_conditional_directive name, target, delimiter, text
         
     | 
| 
       905 
910 
     | 
    
         
             
                # attributes are case insensitive
         
     | 
| 
       906 
911 
     | 
    
         
             
                target = target.downcase unless (no_target = target.empty?)
         
     | 
| 
       907 
912 
     | 
    
         | 
| 
       908 
     | 
    
         
            -
                if  
     | 
| 
      
 913 
     | 
    
         
            +
                if name == 'endif'
         
     | 
| 
       909 
914 
     | 
    
         
             
                  if text
         
     | 
| 
       910 
915 
     | 
    
         
             
                    logger.error message_with_context %(malformed preprocessor directive - text not permitted: endif::#{target}[#{text}]), source_location: cursor
         
     | 
| 
       911 
916 
     | 
    
         
             
                  elsif @conditional_stack.empty?
         
     | 
| 
       912 
917 
     | 
    
         
             
                    logger.error message_with_context %(unmatched preprocessor directive: endif::#{target}[]), source_location: cursor
         
     | 
| 
       913 
     | 
    
         
            -
                  elsif no_target || target ==  
     | 
| 
      
 918 
     | 
    
         
            +
                  elsif no_target || target == @conditional_stack[-1][:target]
         
     | 
| 
       914 
919 
     | 
    
         
             
                    @conditional_stack.pop
         
     | 
| 
       915 
920 
     | 
    
         
             
                    @skipping = @conditional_stack.empty? ? false : @conditional_stack[-1][:skipping]
         
     | 
| 
       916 
921 
     | 
    
         
             
                  else
         
     | 
| 
       917 
     | 
    
         
            -
                    logger.error message_with_context %(mismatched preprocessor directive: endif::#{target}[], expected endif::#{ 
     | 
| 
      
 922 
     | 
    
         
            +
                    logger.error message_with_context %(mismatched preprocessor directive: endif::#{target}[], expected endif::#{@conditional_stack[-1][:target] || ''}[]), source_location: cursor
         
     | 
| 
       918 
923 
     | 
    
         
             
                  end
         
     | 
| 
       919 
924 
     | 
    
         
             
                  return true
         
     | 
| 
       920 
925 
     | 
    
         
             
                elsif @skipping
         
     | 
| 
      
 926 
     | 
    
         
            +
                  if name === 'ifeval'
         
     | 
| 
      
 927 
     | 
    
         
            +
                    return true unless no_target && text && (EvalExpressionRx.match? text.strip)
         
     | 
| 
      
 928 
     | 
    
         
            +
                  elsif no_target
         
     | 
| 
      
 929 
     | 
    
         
            +
                    return true
         
     | 
| 
      
 930 
     | 
    
         
            +
                  end
         
     | 
| 
       921 
931 
     | 
    
         
             
                  skip = false
         
     | 
| 
       922 
932 
     | 
    
         
             
                else
         
     | 
| 
       923 
933 
     | 
    
         
             
                  # QUESTION any way to wrap ifdef & ifndef logic up together?
         
     | 
| 
       924 
     | 
    
         
            -
                  case  
     | 
| 
      
 934 
     | 
    
         
            +
                  case name
         
     | 
| 
       925 
935 
     | 
    
         
             
                  when 'ifdef'
         
     | 
| 
       926 
936 
     | 
    
         
             
                    if no_target
         
     | 
| 
       927 
937 
     | 
    
         
             
                      logger.error message_with_context %(malformed preprocessor directive - missing target: ifdef::[#{text}]), source_location: cursor
         
     | 
| 
         @@ -930,10 +940,10 @@ class PreprocessorReader < Reader 
     | 
|
| 
       930 
940 
     | 
    
         
             
                    case delimiter
         
     | 
| 
       931 
941 
     | 
    
         
             
                    when ','
         
     | 
| 
       932 
942 
     | 
    
         
             
                      # skip if no attribute is defined
         
     | 
| 
       933 
     | 
    
         
            -
                      skip = target.split(',', -1).none? {| 
     | 
| 
      
 943 
     | 
    
         
            +
                      skip = target.split(',', -1).none? {|attr_name| @document.attributes.key? attr_name }
         
     | 
| 
       934 
944 
     | 
    
         
             
                    when '+'
         
     | 
| 
       935 
945 
     | 
    
         
             
                      # skip if any attribute is undefined
         
     | 
| 
       936 
     | 
    
         
            -
                      skip = target.split('+', -1).any? {| 
     | 
| 
      
 946 
     | 
    
         
            +
                      skip = target.split('+', -1).any? {|attr_name| !@document.attributes.key? attr_name }
         
     | 
| 
       937 
947 
     | 
    
         
             
                    else
         
     | 
| 
       938 
948 
     | 
    
         
             
                      # if the attribute is undefined, then skip
         
     | 
| 
       939 
949 
     | 
    
         
             
                      skip = !@document.attributes.key?(target)
         
     | 
| 
         @@ -946,10 +956,10 @@ class PreprocessorReader < Reader 
     | 
|
| 
       946 
956 
     | 
    
         
             
                    case delimiter
         
     | 
| 
       947 
957 
     | 
    
         
             
                    when ','
         
     | 
| 
       948 
958 
     | 
    
         
             
                      # skip if any attribute is defined
         
     | 
| 
       949 
     | 
    
         
            -
                      skip = target.split(',', -1).any? {| 
     | 
| 
      
 959 
     | 
    
         
            +
                      skip = target.split(',', -1).any? {|attr_name| @document.attributes.key? attr_name }
         
     | 
| 
       950 
960 
     | 
    
         
             
                    when '+'
         
     | 
| 
       951 
961 
     | 
    
         
             
                      # skip if all attributes are defined
         
     | 
| 
       952 
     | 
    
         
            -
                      skip = target.split('+', -1).all? {| 
     | 
| 
      
 962 
     | 
    
         
            +
                      skip = target.split('+', -1).all? {|attr_name| @document.attributes.key? attr_name }
         
     | 
| 
       953 
963 
     | 
    
         
             
                    else
         
     | 
| 
       954 
964 
     | 
    
         
             
                      # if the attribute is defined, then skip
         
     | 
| 
       955 
965 
     | 
    
         
             
                      skip = @document.attributes.key?(target)
         
     | 
| 
         @@ -976,11 +986,11 @@ class PreprocessorReader < Reader 
     | 
|
| 
       976 
986 
     | 
    
         
             
                end
         
     | 
| 
       977 
987 
     | 
    
         | 
| 
       978 
988 
     | 
    
         
             
                # conditional inclusion block
         
     | 
| 
       979 
     | 
    
         
            -
                if  
     | 
| 
      
 989 
     | 
    
         
            +
                if name == 'ifeval'
         
     | 
| 
       980 
990 
     | 
    
         
             
                  @skipping = true if skip
         
     | 
| 
       981 
     | 
    
         
            -
                  @conditional_stack << {  
     | 
| 
      
 991 
     | 
    
         
            +
                  @conditional_stack << { name: name, expr: text, skip: skip, skipping: @skipping, source_location: @sourcemap ? cursor : nil }
         
     | 
| 
       982 
992 
     | 
    
         
             
                # single line conditional inclusion
         
     | 
| 
       983 
     | 
    
         
            -
                 
     | 
| 
      
 993 
     | 
    
         
            +
                elsif text
         
     | 
| 
       984 
994 
     | 
    
         
             
                  unless @skipping || skip
         
     | 
| 
       985 
995 
     | 
    
         
             
                    replace_next_line text.rstrip
         
     | 
| 
       986 
996 
     | 
    
         
             
                    # HACK push dummy line to stand in for the opening conditional directive that's subsequently dropped
         
     | 
| 
         @@ -989,6 +999,10 @@ class PreprocessorReader < Reader 
     | 
|
| 
       989 
999 
     | 
    
         
             
                    # QUESTION should we just call preprocess_include_directive here?
         
     | 
| 
       990 
1000 
     | 
    
         
             
                    @look_ahead -= 1 if text.start_with? 'include::'
         
     | 
| 
       991 
1001 
     | 
    
         
             
                  end
         
     | 
| 
      
 1002 
     | 
    
         
            +
                # conditional inclusion block
         
     | 
| 
      
 1003 
     | 
    
         
            +
                else
         
     | 
| 
      
 1004 
     | 
    
         
            +
                  @skipping = true if skip
         
     | 
| 
      
 1005 
     | 
    
         
            +
                  @conditional_stack << { name: name, target: target, skip: skip, skipping: @skipping, source_location: @sourcemap ? cursor : nil }
         
     | 
| 
       992 
1006 
     | 
    
         
             
                end
         
     | 
| 
       993 
1007 
     | 
    
         | 
| 
       994 
1008 
     | 
    
         
             
                true
         
     | 
| 
         @@ -1043,9 +1057,9 @@ class PreprocessorReader < Reader 
     | 
|
| 
       1043 
1057 
     | 
    
         
             
                # if running in SafeMode::SECURE or greater, don't process this directive
         
     | 
| 
       1044 
1058 
     | 
    
         
             
                # however, be friendly and at least make it a link to the source document
         
     | 
| 
       1045 
1059 
     | 
    
         
             
                elsif doc.safe >= SafeMode::SECURE
         
     | 
| 
      
 1060 
     | 
    
         
            +
                  # FIXME we don't want to use a passthrough or link macro if we're in a verbatim context
         
     | 
| 
       1046 
1061 
     | 
    
         
             
                  expanded_target = %(pass:c[#{expanded_target}]) if expanded_target.include? ' '
         
     | 
| 
       1047 
     | 
    
         
            -
                  #  
     | 
| 
       1048 
     | 
    
         
            -
                  replace_next_line %(link:#{expanded_target}[role=include])
         
     | 
| 
      
 1062 
     | 
    
         
            +
                  replace_next_line %(link:#{expanded_target}[#{(doc.attr? 'compat-mode') ? '' : 'role=include'}])
         
     | 
| 
       1049 
1063 
     | 
    
         
             
                elsif @maxdepth
         
     | 
| 
       1050 
1064 
     | 
    
         
             
                  if @include_stack.size >= @maxdepth[:curr]
         
     | 
| 
       1051 
1065 
     | 
    
         
             
                    logger.error message_with_context %(maximum include depth of #{@maxdepth[:rel]} exceeded), source_location: cursor
         
     | 
| 
         @@ -1244,17 +1258,11 @@ class PreprocessorReader < Reader 
     | 
|
| 
       1244 
1258 
     | 
    
         
             
                doc = @document
         
     | 
| 
       1245 
1259 
     | 
    
         
             
                if (Helpers.uriish? target) || (::String === @dir ? nil : (target = %(#{@dir}/#{target})))
         
     | 
| 
       1246 
1260 
     | 
    
         
             
                  unless doc.attr? 'allow-uri-read'
         
     | 
| 
      
 1261 
     | 
    
         
            +
                   # FIXME we don't want to use a passthrough or link macro if we're in a verbatim context
         
     | 
| 
       1247 
1262 
     | 
    
         
             
                    target = %(pass:c[#{target}]) if target.include? ' '
         
     | 
| 
       1248 
     | 
    
         
            -
                    return replace_next_line %(link:#{target}[role=include])
         
     | 
| 
       1249 
     | 
    
         
            -
                  end
         
     | 
| 
       1250 
     | 
    
         
            -
                  if doc.attr? 'cache-uri'
         
     | 
| 
       1251 
     | 
    
         
            -
                    # caching requires the open-uri-cached gem to be installed
         
     | 
| 
       1252 
     | 
    
         
            -
                    # processing will be automatically aborted if these libraries can't be opened
         
     | 
| 
       1253 
     | 
    
         
            -
                    Helpers.require_library 'open-uri/cached', 'open-uri-cached' unless defined? ::OpenURI::Cache
         
     | 
| 
       1254 
     | 
    
         
            -
                  elsif !RUBY_ENGINE_OPAL
         
     | 
| 
       1255 
     | 
    
         
            -
                    # autoload open-uri
         
     | 
| 
       1256 
     | 
    
         
            -
                    ::OpenURI
         
     | 
| 
      
 1263 
     | 
    
         
            +
                    return replace_next_line %(link:#{target}[#{(doc.attr? 'compat-mode') ? '' : 'role=include'}])
         
     | 
| 
       1257 
1264 
     | 
    
         
             
                  end
         
     | 
| 
      
 1265 
     | 
    
         
            +
                  Helpers.require_open_uri doc.attr? 'cache-uri'
         
     | 
| 
       1258 
1266 
     | 
    
         
             
                  [(::URI.parse target), :uri, target]
         
     | 
| 
       1259 
1267 
     | 
    
         
             
                else
         
     | 
| 
       1260 
1268 
     | 
    
         
             
                  # include file is resolved relative to dir of current include, or base_dir if within original docfile
         
     | 
    
        data/lib/asciidoctor/rx.rb
    CHANGED
    
    | 
         @@ -440,10 +440,10 @@ module Asciidoctor 
     | 
|
| 
       440 
440 
     | 
    
         
             
              #   anchor:idname[]
         
     | 
| 
       441 
441 
     | 
    
         
             
              #   anchor:idname[Reference Text]
         
     | 
| 
       442 
442 
     | 
    
         
             
              #
         
     | 
| 
       443 
     | 
    
         
            -
              InlineAnchorRx = /(\\)?(?:\[\[([#{CC_ALPHA}_:][#{CC_WORD}\-:.]*)(?:, *(#{CC_ANY}+?))?\]\]|anchor:([#{CC_ALPHA}_:][#{CC_WORD}\-:.]*)\[(?:\]|(#{CC_ANY}*?[^\\])\]))/
         
     | 
| 
      
 443 
     | 
    
         
            +
              InlineAnchorRx = /(\\)?(?:\[\[([#{CC_ALPHA}_:][#{CC_WORD}\-:.]*)(?:, *(#{CC_ANY}+?))? ?\]\]|anchor:([#{CC_ALPHA}_:][#{CC_WORD}\-:.]*)\[(?:\]|(#{CC_ANY}*?[^\\])\]))/
         
     | 
| 
       444 
444 
     | 
    
         | 
| 
       445 
445 
     | 
    
         
             
              # Scans for a non-escaped anchor (i.e., id + optional reference text) in the flow of text.
         
     | 
| 
       446 
     | 
    
         
            -
              InlineAnchorScanRx = /(?:^|[^\\\[])\[\[([#{CC_ALPHA}_:][#{CC_WORD}\-:.]*)(?:, *(#{CC_ANY}+?))?\]\]|(?:^|[^\\])anchor:([#{CC_ALPHA}_:][#{CC_WORD}\-:.]*)\[(?:\]|(#{CC_ANY}*?[^\\])\])/
         
     | 
| 
      
 446 
     | 
    
         
            +
              InlineAnchorScanRx = /(?:^|[^\\\[])\[\[([#{CC_ALPHA}_:][#{CC_WORD}\-:.]*)(?:, *(#{CC_ANY}+?))? ?\]\]|(?:^|[^\\])anchor:([#{CC_ALPHA}_:][#{CC_WORD}\-:.]*)\[(?:\]|(#{CC_ANY}*?[^\\])\])/
         
     | 
| 
       447 
447 
     | 
    
         | 
| 
       448 
448 
     | 
    
         
             
              # Scans for a leading, non-escaped anchor (i.e., id + optional reference text).
         
     | 
| 
       449 
449 
     | 
    
         
             
              LeadingInlineAnchorRx = /^\[\[([#{CC_ALPHA}_:][#{CC_WORD}\-:.]*)(?:, *(#{CC_ANY}+?))?\]\]/
         
     | 
| 
         @@ -384,7 +384,7 @@ module Substitutors 
     | 
|
| 
       384 
384 
     | 
    
         
             
                      if (items = $2)
         
     | 
| 
       385 
385 
     | 
    
         
             
                        items = items.gsub ESC_R_SB, R_SB if items.include? R_SB
         
     | 
| 
       386 
386 
     | 
    
         
             
                        if (delim = items.include?('>') ? '>' : (items.include?(',') ? ',' : nil))
         
     | 
| 
       387 
     | 
    
         
            -
                          submenus = items.split(delim).map {| 
     | 
| 
      
 387 
     | 
    
         
            +
                          submenus = items.split(delim).map {|item| item.strip }
         
     | 
| 
       388 
388 
     | 
    
         
             
                          menuitem = submenus.pop
         
     | 
| 
       389 
389 
     | 
    
         
             
                        else
         
     | 
| 
       390 
390 
     | 
    
         
             
                          submenus, menuitem = [], items.rstrip
         
     | 
| 
         @@ -402,7 +402,7 @@ module Substitutors 
     | 
|
| 
       402 
402 
     | 
    
         
             
                      # honor the escape
         
     | 
| 
       403 
403 
     | 
    
         
             
                      next $&.slice 1, $&.length if $&.start_with? RS
         
     | 
| 
       404 
404 
     | 
    
         | 
| 
       405 
     | 
    
         
            -
                      menu, *submenus = $1.split('>').map {| 
     | 
| 
      
 405 
     | 
    
         
            +
                      menu, *submenus = $1.split('>').map {|item| item.strip }
         
     | 
| 
       406 
406 
     | 
    
         
             
                      menuitem = submenus.pop
         
     | 
| 
       407 
407 
     | 
    
         
             
                      Inline.new(self, :menu, nil, attributes: { 'menu' => menu, 'submenus' => submenus, 'menuitem' => menuitem }).convert
         
     | 
| 
       408 
408 
     | 
    
         
             
                    end
         
     | 
| 
         @@ -454,7 +454,7 @@ module Substitutors 
     | 
|
| 
       454 
454 
     | 
    
         
             
                          end
         
     | 
| 
       455 
455 
     | 
    
         
             
                          attrs['terms'] = terms
         
     | 
| 
       456 
456 
     | 
    
         
             
                          if (see_also = attrs['see-also'])
         
     | 
| 
       457 
     | 
    
         
            -
                            attrs['see-also'] = (see_also.include? ',') ? (see_also.split ',').map {| 
     | 
| 
      
 457 
     | 
    
         
            +
                            attrs['see-also'] = (see_also.include? ',') ? (see_also.split ',').map {|item| item.lstrip } : [see_also]
         
     | 
| 
       458 
458 
     | 
    
         
             
                          end
         
     | 
| 
       459 
459 
     | 
    
         
             
                        else
         
     | 
| 
       460 
460 
     | 
    
         
             
                          attrs = { 'terms' => attrlist }
         
     | 
| 
         @@ -471,7 +471,7 @@ module Substitutors 
     | 
|
| 
       471 
471 
     | 
    
         
             
                      if (term = normalize_text $2, true, true).include? '='
         
     | 
| 
       472 
472 
     | 
    
         
             
                        term = (attrs = (AttributeList.new term, self).parse)[1] || (attrs = nil) || term
         
     | 
| 
       473 
473 
     | 
    
         
             
                        if attrs && (see_also = attrs['see-also'])
         
     | 
| 
       474 
     | 
    
         
            -
                          attrs['see-also'] = (see_also.include? ',') ? (see_also.split ',').map {| 
     | 
| 
      
 474 
     | 
    
         
            +
                          attrs['see-also'] = (see_also.include? ',') ? (see_also.split ',').map {|item| item.lstrip } : [see_also]
         
     | 
| 
       475 
475 
     | 
    
         
             
                        end
         
     | 
| 
       476 
476 
     | 
    
         
             
                      end
         
     | 
| 
       477 
477 
     | 
    
         
             
                      (Inline.new self, :indexterm, term, attributes: attrs, type: :visible).convert
         
     | 
| 
         @@ -1005,7 +1005,7 @@ module Substitutors 
     | 
|
| 
       1005 
1005 
     | 
    
         
             
                end
         
     | 
| 
       1006 
1006 
     | 
    
         
             
                # If the start attribute is defined, then the lines to highlight specified by the provided spec should be relative to the start value.
         
     | 
| 
       1007 
1007 
     | 
    
         
             
                unless (shift = start ? start - 1 : 0) == 0
         
     | 
| 
       1008 
     | 
    
         
            -
                  lines = lines.map {| 
     | 
| 
      
 1008 
     | 
    
         
            +
                  lines = lines.map {|n| n - shift }
         
     | 
| 
       1009 
1009 
     | 
    
         
             
                end
         
     | 
| 
       1010 
1010 
     | 
    
         
             
                lines.sort
         
     | 
| 
       1011 
1011 
     | 
    
         
             
              end
         
     | 
| 
         @@ -1541,7 +1541,7 @@ module Substitutors 
     | 
|
| 
       1541 
1541 
     | 
    
         
             
                  end
         
     | 
| 
       1542 
1542 
     | 
    
         
             
                  values << accum.strip
         
     | 
| 
       1543 
1543 
     | 
    
         
             
                else
         
     | 
| 
       1544 
     | 
    
         
            -
                  str.split(',').map {| 
     | 
| 
      
 1544 
     | 
    
         
            +
                  str.split(',').map {|item| item.strip }
         
     | 
| 
       1545 
1545 
     | 
    
         
             
                end
         
     | 
| 
       1546 
1546 
     | 
    
         
             
              end
         
     | 
| 
       1547 
1547 
     | 
    
         
             
            end
         
     | 
| 
         @@ -16,14 +16,15 @@ class SyntaxHighlighter::CodeRayAdapter < SyntaxHighlighter::Base 
     | 
|
| 
       16 
16 
     | 
    
         
             
              def highlight node, source, lang, opts
         
     | 
| 
       17 
17 
     | 
    
         
             
                @requires_stylesheet = true if (css_mode = opts[:css_mode]) == :class
         
     | 
| 
       18 
18 
     | 
    
         
             
                lang = lang ? (::CodeRay::Scanners[lang = lang.to_sym] && lang rescue :text) : :text
         
     | 
| 
       19 
     | 
    
         
            -
                 
     | 
| 
      
 19 
     | 
    
         
            +
                highlighter_opts = {
         
     | 
| 
       20 
20 
     | 
    
         
             
                  css: css_mode,
         
     | 
| 
       21 
21 
     | 
    
         
             
                  line_numbers: (line_numbers = opts[:number_lines]),
         
     | 
| 
       22 
22 
     | 
    
         
             
                  line_number_start: opts[:start_line_number],
         
     | 
| 
       23 
23 
     | 
    
         
             
                  line_number_anchors: false,
         
     | 
| 
       24 
24 
     | 
    
         
             
                  highlight_lines: opts[:highlight_lines],
         
     | 
| 
       25 
25 
     | 
    
         
             
                  bold_every: false,
         
     | 
| 
       26 
     | 
    
         
            -
                 
     | 
| 
      
 26 
     | 
    
         
            +
                }
         
     | 
| 
      
 27 
     | 
    
         
            +
                highlighted = ::CodeRay::Duo[lang, :html, highlighter_opts].highlight source
         
     | 
| 
       27 
28 
     | 
    
         
             
                if line_numbers == :table && opts[:callouts]
         
     | 
| 
       28 
29 
     | 
    
         
             
                  [highlighted, (idx = highlighted.index CodeCellStartTagCs) ? idx + CodeCellStartTagCs.length : nil]
         
     | 
| 
       29 
30 
     | 
    
         
             
                else
         
     | 
    
        data/lib/asciidoctor/version.rb
    CHANGED
    
    
    
        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. 
     | 
| 
      
 4 
     | 
    
         
            +
            .\" Generator: Asciidoctor 2.0.24
         
     | 
| 
       5 
5 
     | 
    
         
             
            .\"      Date: 2018-03-20
         
     | 
| 
       6 
6 
     | 
    
         
             
            .\"    Manual: Asciidoctor Manual
         
     | 
| 
       7 
     | 
    
         
            -
            .\"    Source: Asciidoctor 2.0. 
     | 
| 
      
 7 
     | 
    
         
            +
            .\"    Source: Asciidoctor 2.0.25
         
     | 
| 
       8 
8 
     | 
    
         
             
            .\"  Language: English
         
     | 
| 
       9 
9 
     | 
    
         
             
            .\"
         
     | 
| 
       10 
     | 
    
         
            -
            .TH "ASCIIDOCTOR" "1" "2018-03-20" "Asciidoctor 2.0. 
     | 
| 
      
 10 
     | 
    
         
            +
            .TH "ASCIIDOCTOR" "1" "2018-03-20" "Asciidoctor 2.0.25" "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
    
    
    
        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. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 2.0.25
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Dan Allen
         
     | 
| 
         @@ -10,7 +10,7 @@ authors: 
     | 
|
| 
       10 
10 
     | 
    
         
             
            - Jason Porter
         
     | 
| 
       11 
11 
     | 
    
         
             
            - Nick Hengeveld
         
     | 
| 
       12 
12 
     | 
    
         
             
            - Jeremy McAnally
         
     | 
| 
       13 
     | 
    
         
            -
            autorequire: 
     | 
| 
      
 13 
     | 
    
         
            +
            autorequire:
         
     | 
| 
       14 
14 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       15 
15 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       16 
16 
     | 
    
         
             
            date: 2018-03-20 00:00:00.000000000 Z
         
     | 
| 
         @@ -63,14 +63,14 @@ dependencies: 
     | 
|
| 
       63 
63 
     | 
    
         
             
                requirements:
         
     | 
| 
       64 
64 
     | 
    
         
             
                - - "~>"
         
     | 
| 
       65 
65 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       66 
     | 
    
         
            -
                    version: 6. 
     | 
| 
      
 66 
     | 
    
         
            +
                    version: 6.3.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: 6. 
     | 
| 
      
 73 
     | 
    
         
            +
                    version: 6.3.0
         
     | 
| 
       74 
74 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       75 
75 
     | 
    
         
             
              name: minitest
         
     | 
| 
       76 
76 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
         @@ -257,7 +257,8 @@ metadata: 
     | 
|
| 
       257 
257 
     | 
    
         
             
              changelog_uri: https://github.com/asciidoctor/asciidoctor/blob/HEAD/CHANGELOG.adoc
         
     | 
| 
       258 
258 
     | 
    
         
             
              mailing_list_uri: https://chat.asciidoctor.org
         
     | 
| 
       259 
259 
     | 
    
         
             
              source_code_uri: https://github.com/asciidoctor/asciidoctor
         
     | 
| 
       260 
     | 
    
         
            -
             
     | 
| 
      
 260 
     | 
    
         
            +
              funding_uri: https://opencollective.com/asciidoctor
         
     | 
| 
      
 261 
     | 
    
         
            +
            post_install_message:
         
     | 
| 
       261 
262 
     | 
    
         
             
            rdoc_options: []
         
     | 
| 
       262 
263 
     | 
    
         
             
            require_paths:
         
     | 
| 
       263 
264 
     | 
    
         
             
            - lib
         
     | 
| 
         @@ -272,8 +273,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       272 
273 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       273 
274 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       274 
275 
     | 
    
         
             
            requirements: []
         
     | 
| 
       275 
     | 
    
         
            -
            rubygems_version: 3.5. 
     | 
| 
       276 
     | 
    
         
            -
            signing_key: 
     | 
| 
      
 276 
     | 
    
         
            +
            rubygems_version: 3.5.22
         
     | 
| 
      
 277 
     | 
    
         
            +
            signing_key:
         
     | 
| 
       277 
278 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       278 
279 
     | 
    
         
             
            summary: An implementation of the AsciiDoc text processor and publishing toolchain
         
     | 
| 
       279 
280 
     | 
    
         
             
            test_files: []
         
     |