asciidoctor 1.5.6.2 → 1.5.7
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.
Potentially problematic release.
This version of asciidoctor might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.adoc +330 -143
- data/README-fr.adoc +441 -0
- data/README-jp.adoc +418 -0
- data/README-zh_CN.adoc +430 -0
- data/README.adoc +454 -0
- data/Rakefile +57 -0
- data/asciidoctor.gemspec +7 -1
- data/data/locale/attributes-ar.adoc +22 -0
- data/data/locale/attributes-bg.adoc +22 -0
- data/data/locale/attributes-ca.adoc +22 -0
- data/data/locale/attributes-cs.adoc +22 -0
- data/data/locale/attributes-da.adoc +22 -0
- data/data/locale/attributes-de.adoc +22 -0
- data/data/locale/attributes-en.adoc +23 -0
- data/data/locale/attributes-es.adoc +22 -0
- data/data/locale/attributes-fa.adoc +22 -0
- data/data/locale/attributes-fi.adoc +22 -0
- data/data/locale/attributes-fr.adoc +22 -0
- data/data/locale/attributes-hu.adoc +22 -0
- data/data/locale/attributes-id.adoc +22 -0
- data/data/locale/attributes-it.adoc +22 -0
- data/data/locale/attributes-ja.adoc +22 -0
- data/data/locale/attributes-kr.adoc +22 -0
- data/data/locale/attributes-nb.adoc +22 -0
- data/data/locale/attributes-nl.adoc +22 -0
- data/data/locale/attributes-nn.adoc +22 -0
- data/data/locale/attributes-pl.adoc +22 -0
- data/data/locale/attributes-pt.adoc +22 -0
- data/data/locale/attributes-pt_BR.adoc +22 -0
- data/data/locale/attributes-ro.adoc +22 -0
- data/data/locale/attributes-ru.adoc +22 -0
- data/data/locale/attributes-sr.adoc +22 -0
- data/data/locale/attributes-sr_Latn.adoc +22 -0
- data/data/locale/attributes-tr.adoc +22 -0
- data/data/locale/attributes-uk.adoc +22 -0
- data/data/locale/attributes-zh_CN.adoc +22 -0
- data/data/locale/attributes-zh_TW.adoc +22 -0
- data/data/locale/attributes.adoc +8 -649
- data/data/stylesheets/asciidoctor-default.css +77 -72
- data/features/xref.feature +366 -7
- data/lib/asciidoctor.rb +107 -93
- data/lib/asciidoctor/abstract_block.rb +247 -239
- data/lib/asciidoctor/abstract_node.rb +56 -58
- data/lib/asciidoctor/block.rb +3 -3
- data/lib/asciidoctor/callouts.rb +1 -1
- data/lib/asciidoctor/cli/invoker.rb +36 -9
- data/lib/asciidoctor/cli/options.rb +63 -25
- data/lib/asciidoctor/converter.rb +23 -13
- data/lib/asciidoctor/converter/base.rb +4 -0
- data/lib/asciidoctor/converter/docbook45.rb +16 -9
- data/lib/asciidoctor/converter/docbook5.rb +115 -97
- data/lib/asciidoctor/converter/factory.rb +29 -31
- data/lib/asciidoctor/converter/html5.rb +229 -192
- data/lib/asciidoctor/converter/manpage.rb +72 -50
- data/lib/asciidoctor/converter/template.rb +12 -12
- data/lib/asciidoctor/core_ext.rb +5 -1
- data/lib/asciidoctor/core_ext/1.8.7/base64/strict_encode64.rb +6 -0
- data/lib/asciidoctor/document.rb +168 -77
- data/lib/asciidoctor/extensions.rb +79 -47
- data/lib/asciidoctor/helpers.rb +33 -11
- data/lib/asciidoctor/inline.rb +3 -2
- data/lib/asciidoctor/list.rb +2 -1
- data/lib/asciidoctor/logging.rb +122 -0
- data/lib/asciidoctor/parser.rb +406 -382
- data/lib/asciidoctor/path_resolver.rb +169 -162
- data/lib/asciidoctor/reader.rb +166 -121
- data/lib/asciidoctor/section.rb +45 -28
- data/lib/asciidoctor/stylesheets.rb +13 -5
- data/lib/asciidoctor/substitutors.rb +328 -254
- data/lib/asciidoctor/table.rb +105 -48
- data/lib/asciidoctor/timings.rb +34 -6
- data/lib/asciidoctor/version.rb +1 -1
- data/man/asciidoctor.1 +41 -23
- data/man/asciidoctor.adoc +14 -8
- data/test/api_test.rb +1004 -0
- data/test/attributes_test.rb +241 -50
- data/test/blocks_test.rb +549 -124
- data/test/converter_test.rb +170 -78
- data/test/document_test.rb +208 -767
- data/test/extensions_test.rb +188 -53
- data/test/fixtures/custom-backends/slim/html5/block_paragraph.html.slim +1 -1
- data/test/fixtures/custom-backends/slim/html5/block_sidebar.html.slim +1 -1
- data/test/fixtures/file-with-missing-include.adoc +1 -0
- data/test/fixtures/include-file.jsx +8 -0
- data/test/fixtures/lists.adoc +96 -0
- data/test/fixtures/other-chapters.adoc +11 -0
- data/test/fixtures/outer-include.adoc +5 -0
- data/test/fixtures/sample.asciidoc +5 -1
- data/test/fixtures/subdir/index.adoc +3 -0
- data/test/fixtures/subdir/inner-include.adoc +3 -0
- data/test/fixtures/subdir/middle-include.adoc +5 -0
- data/test/fixtures/tagged-class-enclosed.rb +0 -1
- data/test/fixtures/unclosed-tag.adoc +3 -0
- data/test/fixtures/unexpected-end-tag.adoc +4 -0
- data/test/invoker_test.rb +101 -40
- data/test/links_test.rb +266 -72
- data/test/lists_test.rb +243 -45
- data/test/logger_test.rb +211 -0
- data/test/manpage_test.rb +124 -6
- data/test/options_test.rb +46 -1
- data/test/paragraphs_test.rb +23 -10
- data/test/parser_test.rb +30 -1
- data/test/paths_test.rb +115 -33
- data/test/preamble_test.rb +1 -1
- data/test/reader_test.rb +337 -81
- data/test/sections_test.rb +656 -72
- data/test/substitutions_test.rb +182 -57
- data/test/tables_test.rb +324 -57
- data/test/test_helper.rb +77 -32
- data/test/text_test.rb +7 -7
- metadata +67 -3
    
        data/test/links_test.rb
    CHANGED
    
    | @@ -11,7 +11,7 @@ context 'Links' do | |
| 11 11 | 
             
              end
         | 
| 12 12 |  | 
| 13 13 | 
             
              test 'qualified url with role inline with text' do
         | 
| 14 | 
            -
                assert_xpath "//a[@href='http://asciidoc.org'][@class='bare project'][text() = 'http://asciidoc.org']", render_string("The AsciiDoc project is located at http://asciidoc.org[ | 
| 14 | 
            +
                assert_xpath "//a[@href='http://asciidoc.org'][@class='bare project'][text() = 'http://asciidoc.org']", render_string("The AsciiDoc project is located at http://asciidoc.org[role=project].")
         | 
| 15 15 | 
             
              end
         | 
| 16 16 |  | 
| 17 17 | 
             
              test 'qualified http url inline with hide-uri-scheme set' do
         | 
| @@ -43,7 +43,7 @@ context 'Links' do | |
| 43 43 | 
             
              end
         | 
| 44 44 |  | 
| 45 45 | 
             
              test 'qualified url with role using link macro' do
         | 
| 46 | 
            -
                assert_xpath "//a[@href='http://asciidoc.org'][@class='bare project'][text() = 'http://asciidoc.org']", render_string("We're parsing link:http://asciidoc.org[ | 
| 46 | 
            +
                assert_xpath "//a[@href='http://asciidoc.org'][@class='bare project'][text() = 'http://asciidoc.org']", render_string("We're parsing link:http://asciidoc.org[role=project] markup")
         | 
| 47 47 | 
             
              end
         | 
| 48 48 |  | 
| 49 49 | 
             
              test 'qualified url using macro syntax with multi-line label inline with text' do
         | 
| @@ -82,37 +82,57 @@ context 'Links' do | |
| 82 82 | 
             
              end
         | 
| 83 83 |  | 
| 84 84 | 
             
              test 'qualified url with trailing round bracket' do
         | 
| 85 | 
            -
                assert_xpath '//a[@href=" | 
| 85 | 
            +
                assert_xpath '//a[@href="https://asciidoctor.org"][text()="https://asciidoctor.org"]', render_string('Asciidoctor is a Ruby-based AsciiDoc processor (see https://asciidoctor.org)'), 1
         | 
| 86 86 | 
             
              end
         | 
| 87 87 |  | 
| 88 88 | 
             
              test 'qualified url with trailing semi-colon' do
         | 
| 89 | 
            -
                assert_xpath '//a[@href=" | 
| 89 | 
            +
                assert_xpath '//a[@href="https://asciidoctor.org"][text()="https://asciidoctor.org"]', render_string('https://asciidoctor.org; where text gets parsed'), 1
         | 
| 90 90 | 
             
              end
         | 
| 91 91 |  | 
| 92 92 | 
             
              test 'qualified url with trailing colon' do
         | 
| 93 | 
            -
                assert_xpath '//a[@href=" | 
| 93 | 
            +
                assert_xpath '//a[@href="https://asciidoctor.org"][text()="https://asciidoctor.org"]', render_string('https://asciidoctor.org: where text gets parsed'), 1
         | 
| 94 94 | 
             
              end
         | 
| 95 95 |  | 
| 96 96 | 
             
              test 'qualified url in round brackets with trailing colon' do
         | 
| 97 | 
            -
                assert_xpath '//a[@href=" | 
| 97 | 
            +
                assert_xpath '//a[@href="https://asciidoctor.org"][text()="https://asciidoctor.org"]', render_string('(https://asciidoctor.org): where text gets parsed'), 1
         | 
| 98 98 | 
             
              end
         | 
| 99 99 |  | 
| 100 100 | 
             
              test 'qualified url with trailing round bracket followed by colon' do
         | 
| 101 | 
            -
                result = render_embedded_string '(from  | 
| 102 | 
            -
                assert_xpath '//a[@href=" | 
| 103 | 
            -
                assert_xpath '//a[@href=" | 
| 104 | 
            -
                assert_xpath '//a[@href=" | 
| 101 | 
            +
                result = render_embedded_string '(from https://asciidoctor.org): where text gets parsed'
         | 
| 102 | 
            +
                assert_xpath '//a[@href="https://asciidoctor.org"][text()="https://asciidoctor.org"]', result, 1
         | 
| 103 | 
            +
                assert_xpath '//a[@href="https://asciidoctor.org"][text()="https://asciidoctor.org"]/preceding-sibling::text()[.="(from "]', result, 1
         | 
| 104 | 
            +
                assert_xpath '//a[@href="https://asciidoctor.org"][text()="https://asciidoctor.org"]/following-sibling::text()[.="): where text gets parsed"]', result, 1
         | 
| 105 105 | 
             
              end
         | 
| 106 106 |  | 
| 107 107 | 
             
              test 'qualified url in round brackets with trailing semi-colon' do
         | 
| 108 | 
            -
                assert_xpath '//a[@href=" | 
| 108 | 
            +
                assert_xpath '//a[@href="https://asciidoctor.org"][text()="https://asciidoctor.org"]', render_string('(https://asciidoctor.org); where text gets parsed'), 1
         | 
| 109 109 | 
             
              end
         | 
| 110 110 |  | 
| 111 111 | 
             
              test 'qualified url with trailing round bracket followed by semi-colon' do
         | 
| 112 | 
            -
                result = render_embedded_string '(from  | 
| 113 | 
            -
                assert_xpath '//a[@href=" | 
| 114 | 
            -
                assert_xpath '//a[@href=" | 
| 115 | 
            -
                assert_xpath '//a[@href=" | 
| 112 | 
            +
                result = render_embedded_string '(from https://asciidoctor.org); where text gets parsed'
         | 
| 113 | 
            +
                assert_xpath '//a[@href="https://asciidoctor.org"][text()="https://asciidoctor.org"]', result, 1
         | 
| 114 | 
            +
                assert_xpath '//a[@href="https://asciidoctor.org"][text()="https://asciidoctor.org"]/preceding-sibling::text()[.="(from "]', result, 1
         | 
| 115 | 
            +
                assert_xpath '//a[@href="https://asciidoctor.org"][text()="https://asciidoctor.org"]/following-sibling::text()[.="); where text gets parsed"]', result, 1
         | 
| 116 | 
            +
              end
         | 
| 117 | 
            +
             | 
| 118 | 
            +
              test 'URI scheme with trailing characters should not be converted to a link' do
         | 
| 119 | 
            +
                input_sources = %w(
         | 
| 120 | 
            +
                  (https://)
         | 
| 121 | 
            +
                  http://;
         | 
| 122 | 
            +
                  file://:
         | 
| 123 | 
            +
                  <ftp://>
         | 
| 124 | 
            +
                )
         | 
| 125 | 
            +
                expected_outputs = %w(
         | 
| 126 | 
            +
                  (https://)
         | 
| 127 | 
            +
                  http://;
         | 
| 128 | 
            +
                  file://:
         | 
| 129 | 
            +
                  <ftp://>
         | 
| 130 | 
            +
                )
         | 
| 131 | 
            +
                input_sources.each_with_index do |input_source, i|
         | 
| 132 | 
            +
                  expected_output = expected_outputs[i]
         | 
| 133 | 
            +
                  actual = block_from_string input_source
         | 
| 134 | 
            +
                  assert_equal expected_output, actual.content
         | 
| 135 | 
            +
                end
         | 
| 116 136 | 
             
              end
         | 
| 117 137 |  | 
| 118 138 | 
             
              test 'qualified url containing round brackets' do
         | 
| @@ -176,26 +196,35 @@ context 'Links' do | |
| 176 196 | 
             
                assert_xpath '//a[@href="https://github.com/asciidoctor"]', render_string('Asciidoctor GitHub organization: <**https://github.com/asciidoctor**>'), 1
         | 
| 177 197 | 
             
              end
         | 
| 178 198 |  | 
| 179 | 
            -
              test 'link with quoted text should not be separated into attributes when  | 
| 180 | 
            -
                assert_xpath '//a[@href="http://search.example.com"][text()="Google, Yahoo, Bing = Search Engines"]', render_embedded_string('http://search.example.com["Google, Yahoo, Bing = Search Engines"]' | 
| 199 | 
            +
              test 'link with quoted text should not be separated into attributes when text contains an equal sign' do
         | 
| 200 | 
            +
                assert_xpath '//a[@href="http://search.example.com"][text()="Google, Yahoo, Bing = Search Engines"]', render_embedded_string('http://search.example.com["Google, Yahoo, Bing = Search Engines"]'), 1
         | 
| 201 | 
            +
              end
         | 
| 202 | 
            +
             | 
| 203 | 
            +
              test 'link with quoted text but no equal sign should carry quotes over to output' do
         | 
| 204 | 
            +
                assert_xpath %(//a[@href="http://search.example.com"][text()='"Google, Yahoo, Bing"']), render_embedded_string('http://search.example.com["Google, Yahoo, Bing"]'), 1
         | 
| 181 205 | 
             
              end
         | 
| 182 206 |  | 
| 183 | 
            -
              test 'link with comma in text but no equal sign should not be separated into attributes | 
| 184 | 
            -
                assert_xpath '//a[@href="http://search.example.com"][text()="Google, Yahoo, Bing"]', render_embedded_string('http://search.example.com[Google, Yahoo, Bing]' | 
| 207 | 
            +
              test 'link with comma in text but no equal sign should not be separated into attributes' do
         | 
| 208 | 
            +
                assert_xpath '//a[@href="http://search.example.com"][text()="Google, Yahoo, Bing"]', render_embedded_string('http://search.example.com[Google, Yahoo, Bing]'), 1
         | 
| 185 209 | 
             
              end
         | 
| 186 210 |  | 
| 187 | 
            -
              test 'role and window attributes on link are processed | 
| 188 | 
            -
                assert_xpath '//a[@href="http://google.com"][@class="external"][@target="_blank"]', render_embedded_string('http://google.com[Google, role= | 
| 211 | 
            +
              test 'role and window attributes on link are processed' do
         | 
| 212 | 
            +
                assert_xpath '//a[@href="http://google.com"][@class="external"][@target="_blank"]', render_embedded_string('http://google.com[Google, role=external, window="_blank"]'), 1
         | 
| 213 | 
            +
              end
         | 
| 214 | 
            +
             | 
| 215 | 
            +
              test 'link macro with attributes but no text should use URL as text' do
         | 
| 216 | 
            +
                url = 'https://fonts.googleapis.com/css?family=Roboto:400,400italic,'
         | 
| 217 | 
            +
                assert_xpath %(//a[@href="#{url}"][text()="#{url}"]), render_embedded_string(%(link:#{url}[family=Roboto,weight=400])), 1
         | 
| 189 218 | 
             
              end
         | 
| 190 219 |  | 
| 191 | 
            -
              test 'link macro with attributes but  | 
| 220 | 
            +
              test 'link macro with attributes but blank text should use URL as text' do
         | 
| 192 221 | 
             
                url = 'https://fonts.googleapis.com/css?family=Roboto:400,400italic,'
         | 
| 193 | 
            -
                assert_xpath %(//a[@href="#{url}"][text()="#{url}"]), render_embedded_string(%(link:#{url}[family=Roboto,weight=400]) | 
| 222 | 
            +
                assert_xpath %(//a[@href="#{url}"][text()="#{url}"]), render_embedded_string(%(link:#{url}[,family=Roboto,weight=400])), 1
         | 
| 194 223 | 
             
              end
         | 
| 195 224 |  | 
| 196 | 
            -
              test 'link macro with comma but no explicit attributes in text should not parse text | 
| 225 | 
            +
              test 'link macro with comma but no explicit attributes in text should not parse text' do
         | 
| 197 226 | 
             
                url = 'https://fonts.googleapis.com/css?family=Roboto:400,400italic,'
         | 
| 198 | 
            -
                assert_xpath %(//a[@href="#{url}"][text()="Roboto,400"]), render_embedded_string(%(link:#{url}[Roboto,400]) | 
| 227 | 
            +
                assert_xpath %(//a[@href="#{url}"][text()="Roboto,400"]), render_embedded_string(%(link:#{url}[Roboto,400])), 1
         | 
| 199 228 | 
             
              end
         | 
| 200 229 |  | 
| 201 230 | 
             
              test 'link text that ends in ^ should set link window to _blank' do
         | 
| @@ -207,21 +236,25 @@ context 'Links' do | |
| 207 236 | 
             
              end
         | 
| 208 237 |  | 
| 209 238 | 
             
              test 'rel=noopener should be added to a link that targets a named window when the noopener option is set' do
         | 
| 210 | 
            -
                assert_xpath '//a[@href="http://google.com"][@target="name"][@rel="noopener"]', render_embedded_string('http://google.com[Google,window=name,opts=noopener]' | 
| 239 | 
            +
                assert_xpath '//a[@href="http://google.com"][@target="name"][@rel="noopener"]', render_embedded_string('http://google.com[Google,window=name,opts=noopener]'), 1
         | 
| 211 240 | 
             
              end
         | 
| 212 241 |  | 
| 213 242 | 
             
              test 'rel=noopener should not be added to a link if it does not target a window' do
         | 
| 214 | 
            -
                result = render_embedded_string 'http://google.com[Google,opts=noopener]' | 
| 243 | 
            +
                result = render_embedded_string 'http://google.com[Google,opts=noopener]'
         | 
| 215 244 | 
             
                assert_xpath '//a[@href="http://google.com"]', result, 1
         | 
| 216 245 | 
             
                assert_xpath '//a[@href="http://google.com"][@rel="noopener"]', result, 0
         | 
| 217 246 | 
             
              end
         | 
| 218 247 |  | 
| 219 | 
            -
              test ' | 
| 220 | 
            -
                assert_xpath '//a[@href="http://google.com"][@ | 
| 248 | 
            +
              test 'rel=nofollow should be added to a link when the nofollow option is set' do
         | 
| 249 | 
            +
                assert_xpath '//a[@href="http://google.com"][@target="name"][@rel="nofollow noopener"]', render_embedded_string('http://google.com[Google,window=name,opts="nofollow,noopener"]'), 1
         | 
| 221 250 | 
             
              end
         | 
| 222 251 |  | 
| 223 | 
            -
              test ' | 
| 224 | 
            -
                assert_xpath '//a[@href="http://google.com"][@ | 
| 252 | 
            +
              test 'id attribute on link is processed' do
         | 
| 253 | 
            +
                assert_xpath '//a[@href="http://google.com"][@id="link-1"]', render_embedded_string('http://google.com[Google, id="link-1"]'), 1
         | 
| 254 | 
            +
              end
         | 
| 255 | 
            +
             | 
| 256 | 
            +
              test 'title attribute on link is processed' do
         | 
| 257 | 
            +
                assert_xpath '//a[@href="http://google.com"][@title="title-1"]', render_embedded_string('http://google.com[Google, title="title-1"]'), 1
         | 
| 225 258 | 
             
              end
         | 
| 226 259 |  | 
| 227 260 | 
             
              test 'inline irc link' do
         | 
| @@ -236,9 +269,9 @@ context 'Links' do | |
| 236 269 | 
             
                variations = %w([[tigers]] anchor:tigers[])
         | 
| 237 270 | 
             
                variations.each do |anchor|
         | 
| 238 271 | 
             
                  doc = document_from_string %(Here you can read about tigers.#{anchor})
         | 
| 239 | 
            -
                  output = doc. | 
| 272 | 
            +
                  output = doc.convert
         | 
| 240 273 | 
             
                  assert_equal '[tigers]', doc.catalog[:ids]['tigers']
         | 
| 241 | 
            -
                   | 
| 274 | 
            +
                  assert_kind_of Asciidoctor::Inline, doc.catalog[:refs]['tigers']
         | 
| 242 275 | 
             
                  assert_nil doc.catalog[:refs]['tigers'].text
         | 
| 243 276 | 
             
                  assert_xpath '//a[@id = "tigers"]', output, 1
         | 
| 244 277 | 
             
                  assert_xpath '//a[@id = "tigers"]/child::text()', output, 0
         | 
| @@ -249,7 +282,7 @@ context 'Links' do | |
| 249 282 | 
             
                variations = %w([[tigers]] anchor:tigers[])
         | 
| 250 283 | 
             
                variations.each do |anchor|
         | 
| 251 284 | 
             
                  doc = document_from_string %(Here you can read about tigers.\\#{anchor})
         | 
| 252 | 
            -
                  output = doc. | 
| 285 | 
            +
                  output = doc.convert
         | 
| 253 286 | 
             
                  refute doc.catalog[:ids].key?('tigers')
         | 
| 254 287 | 
             
                  refute doc.catalog[:refs].key?('tigers')
         | 
| 255 288 | 
             
                  assert_xpath '//a[@id = "tigers"]', output, 0
         | 
| @@ -272,9 +305,9 @@ context 'Links' do | |
| 272 305 | 
             
              test 'inline ref with reftext' do
         | 
| 273 306 | 
             
                %w([[tigers,Tigers]] anchor:tigers[Tigers]).each do |anchor|
         | 
| 274 307 | 
             
                  doc = document_from_string %(Here you can read about tigers.#{anchor})
         | 
| 275 | 
            -
                  output = doc. | 
| 308 | 
            +
                  output = doc.convert
         | 
| 276 309 | 
             
                  assert_equal 'Tigers', doc.catalog[:ids]['tigers']
         | 
| 277 | 
            -
                   | 
| 310 | 
            +
                  assert_kind_of Asciidoctor::Inline, doc.catalog[:refs]['tigers']
         | 
| 278 311 | 
             
                  assert_equal 'Tigers', doc.catalog[:refs]['tigers'].text
         | 
| 279 312 | 
             
                  assert_xpath '//a[@id = "tigers"]', output, 1
         | 
| 280 313 | 
             
                  assert_xpath '//a[@id = "tigers"]/child::text()', output, 0
         | 
| @@ -290,8 +323,8 @@ context 'Links' do | |
| 290 323 | 
             
              test 'should substitute attribute references in reftext when registering inline ref' do
         | 
| 291 324 | 
             
                %w([[tigers,{label-tigers}]] anchor:tigers[{label-tigers}]).each do |anchor|
         | 
| 292 325 | 
             
                  doc = document_from_string %(Here you can read about tigers.#{anchor}), :attributes => { 'label-tigers' => 'Tigers' }
         | 
| 293 | 
            -
                  doc. | 
| 294 | 
            -
                   | 
| 326 | 
            +
                  doc.convert
         | 
| 327 | 
            +
                  assert_kind_of Asciidoctor::Inline, doc.catalog[:refs]['tigers']
         | 
| 295 328 | 
             
                  assert_equal 'Tigers', doc.catalog[:refs]['tigers'].text
         | 
| 296 329 | 
             
                  assert_equal 'Tigers', doc.catalog[:ids]['tigers']
         | 
| 297 330 | 
             
                end
         | 
| @@ -301,7 +334,7 @@ context 'Links' do | |
| 301 334 | 
             
                %w([[tigers,<Tigers>]] anchor:tigers[<Tigers>]).each do |anchor|
         | 
| 302 335 | 
             
                  doc = document_from_string %(Here you can read about tigers.#{anchor}), :backend => :docbook45
         | 
| 303 336 | 
             
                  output = doc.convert :header_footer => false
         | 
| 304 | 
            -
                   | 
| 337 | 
            +
                  assert_kind_of Asciidoctor::Inline, doc.catalog[:refs]['tigers']
         | 
| 305 338 | 
             
                  assert_equal '<Tigers>', doc.catalog[:refs]['tigers'].text
         | 
| 306 339 | 
             
                  assert_equal '<Tigers>', doc.references[:ids]['tigers']
         | 
| 307 340 | 
             
                  assert_includes output, '<anchor id="tigers" xreflabel="<Tigers>"/>'
         | 
| @@ -349,13 +382,13 @@ anchor:foo[b[a\]r]text' | |
| 349 382 | 
             
              test 'xref using angled bracket syntax' do
         | 
| 350 383 | 
             
                doc = document_from_string '<<tigers>>'
         | 
| 351 384 | 
             
                doc.register :refs, ['tigers', (Asciidoctor::Inline.new doc, :anchor, '[tigers]', :type => :ref, :target => 'tigers'), '[tigers]']
         | 
| 352 | 
            -
                assert_xpath '//a[@href="#tigers"][text() = "[tigers]"]', doc. | 
| 385 | 
            +
                assert_xpath '//a[@href="#tigers"][text() = "[tigers]"]', doc.convert, 1
         | 
| 353 386 | 
             
              end
         | 
| 354 387 |  | 
| 355 388 | 
             
              test 'xref using angled bracket syntax with explicit hash' do
         | 
| 356 389 | 
             
                doc = document_from_string '<<#tigers>>'
         | 
| 357 390 | 
             
                doc.register :refs, ['tigers', (Asciidoctor::Inline.new doc, :anchor, 'Tigers', :type => :ref, :target => 'tigers'), 'Tigers']
         | 
| 358 | 
            -
                assert_xpath '//a[@href="#tigers"][text() = "Tigers"]', doc. | 
| 391 | 
            +
                assert_xpath '//a[@href="#tigers"][text() = "Tigers"]', doc.convert, 1
         | 
| 359 392 | 
             
              end
         | 
| 360 393 |  | 
| 361 394 | 
             
              test 'xref using angled bracket syntax with label' do
         | 
| @@ -378,14 +411,26 @@ anchor:foo[b[a\]r]text' | |
| 378 411 | 
             
                assert_xpath %q(//a[@href="#tigers"][text() = '"About Tigers"']), render_string(input), 1
         | 
| 379 412 | 
             
              end
         | 
| 380 413 |  | 
| 414 | 
            +
              test 'should not interpret path sans extension in xref with angled bracket syntax in compat mode' do
         | 
| 415 | 
            +
                using_memory_logger do |logger|
         | 
| 416 | 
            +
                  doc = document_from_string '<<tigers#>>', :header_footer => false, :attributes => { 'compat-mode' => '' }
         | 
| 417 | 
            +
                  assert_xpath '//a[@href="#tigers#"][text() = "[tigers#]"]', doc.convert, 1
         | 
| 418 | 
            +
                end
         | 
| 419 | 
            +
              end
         | 
| 420 | 
            +
             | 
| 381 421 | 
             
              test 'xref using angled bracket syntax with path sans extension' do
         | 
| 382 422 | 
             
                doc = document_from_string '<<tigers#>>', :header_footer => false
         | 
| 383 | 
            -
                assert_xpath '//a[@href="tigers.html"][text() = "tigers.html"]', doc. | 
| 423 | 
            +
                assert_xpath '//a[@href="tigers.html"][text() = "tigers.html"]', doc.convert, 1
         | 
| 384 424 | 
             
              end
         | 
| 385 425 |  | 
| 386 | 
            -
              test 'inter-document xref should not  | 
| 387 | 
            -
                 | 
| 388 | 
            -
             | 
| 426 | 
            +
              test 'inter-document xref should not add suffix to path with a non-AsciiDoc extension' do
         | 
| 427 | 
            +
                {
         | 
| 428 | 
            +
                  'using-.net-web-services' => 'Using .NET web services',
         | 
| 429 | 
            +
                  '../file.pdf' => 'Download the .pdf file'
         | 
| 430 | 
            +
                }.each do |path, text|
         | 
| 431 | 
            +
                  result = render_embedded_string %(<<#{path}#,#{text}>>)
         | 
| 432 | 
            +
                  assert_xpath %(//a[@href="#{path}"][text() = "#{text}"]), result, 1
         | 
| 433 | 
            +
                end
         | 
| 389 434 | 
             
              end
         | 
| 390 435 |  | 
| 391 436 | 
             
              test 'inter-document xref should only remove the file extension part if the path contains a period elsewhere' do
         | 
| @@ -395,52 +440,94 @@ anchor:foo[b[a\]r]text' | |
| 395 440 |  | 
| 396 441 | 
             
              test 'xref using angled bracket syntax with path sans extension using docbook backend' do
         | 
| 397 442 | 
             
                doc = document_from_string '<<tigers#>>', :header_footer => false, :backend => 'docbook'
         | 
| 398 | 
            -
                assert_match '<link xl:href="tigers.xml">tigers.xml</link>', doc. | 
| 443 | 
            +
                assert_match '<link xl:href="tigers.xml">tigers.xml</link>', doc.convert, 1
         | 
| 399 444 | 
             
                doc = document_from_string '<<tigers#>>', :header_footer => false, :backend => 'docbook45'
         | 
| 400 | 
            -
                assert_match '<ulink url="tigers.xml">tigers.xml</ulink>', doc. | 
| 445 | 
            +
                assert_match '<ulink url="tigers.xml">tigers.xml</ulink>', doc.convert, 1
         | 
| 401 446 | 
             
              end
         | 
| 402 447 |  | 
| 403 448 | 
             
              test 'xref using angled bracket syntax with ancestor path sans extension' do
         | 
| 404 449 | 
             
                doc = document_from_string '<<../tigers#,tigers>>', :header_footer => false
         | 
| 405 | 
            -
                assert_xpath '//a[@href="../tigers.html"][text() = "tigers"]', doc. | 
| 450 | 
            +
                assert_xpath '//a[@href="../tigers.html"][text() = "tigers"]', doc.convert, 1
         | 
| 406 451 | 
             
              end
         | 
| 407 452 |  | 
| 408 453 | 
             
              test 'xref using angled bracket syntax with absolute path sans extension' do
         | 
| 409 454 | 
             
                doc = document_from_string '<</path/to/tigers#,tigers>>', :header_footer => false
         | 
| 410 | 
            -
                assert_xpath '//a[@href="/path/to/tigers.html"][text() = "tigers"]', doc. | 
| 455 | 
            +
                assert_xpath '//a[@href="/path/to/tigers.html"][text() = "tigers"]', doc.convert, 1
         | 
| 411 456 | 
             
              end
         | 
| 412 457 |  | 
| 413 458 | 
             
              test 'xref using angled bracket syntax with path and extension' do
         | 
| 459 | 
            +
                using_memory_logger do |logger|
         | 
| 460 | 
            +
                  doc = document_from_string '<<tigers.adoc>>', :header_footer => false
         | 
| 461 | 
            +
                  assert_xpath '//a[@href="#tigers.adoc"][text() = "[tigers.adoc]"]', doc.convert, 1
         | 
| 462 | 
            +
                end
         | 
| 463 | 
            +
              end
         | 
| 464 | 
            +
             | 
| 465 | 
            +
              test 'xref using angled bracket syntax with path and extension with hash' do
         | 
| 414 466 | 
             
                doc = document_from_string '<<tigers.adoc#>>', :header_footer => false
         | 
| 415 | 
            -
                assert_xpath '//a[@href="tigers.html"][text() = "tigers.html"]', doc. | 
| 467 | 
            +
                assert_xpath '//a[@href="tigers.html"][text() = "tigers.html"]', doc.convert, 1
         | 
| 468 | 
            +
              end
         | 
| 469 | 
            +
             | 
| 470 | 
            +
              test 'xref using angled bracket syntax with path and extension with fragment' do
         | 
| 471 | 
            +
                doc = document_from_string '<<tigers.adoc#id>>', :header_footer => false
         | 
| 472 | 
            +
                assert_xpath '//a[@href="tigers.html#id"][text() = "tigers.html"]', doc.convert, 1
         | 
| 473 | 
            +
              end
         | 
| 474 | 
            +
             | 
| 475 | 
            +
              test 'xref using macro syntax with path and extension in compat mode' do
         | 
| 476 | 
            +
                using_memory_logger do |logger|
         | 
| 477 | 
            +
                  doc = document_from_string 'xref:tigers.adoc[]', :header_footer => false, :attributes => { 'compat-mode' => '' }
         | 
| 478 | 
            +
                  assert_xpath '//a[@href="#tigers.adoc"][text() = "[tigers.adoc]"]', doc.convert, 1
         | 
| 479 | 
            +
                end
         | 
| 480 | 
            +
              end
         | 
| 481 | 
            +
             | 
| 482 | 
            +
              test 'xref using macro syntax with path and extension' do
         | 
| 483 | 
            +
                doc = document_from_string 'xref:tigers.adoc[]', :header_footer => false
         | 
| 484 | 
            +
                assert_xpath '//a[@href="tigers.html"][text() = "tigers.html"]', doc.convert, 1
         | 
| 416 485 | 
             
              end
         | 
| 417 486 |  | 
| 418 487 | 
             
              test 'xref using angled bracket syntax with path and fragment' do
         | 
| 419 488 | 
             
                doc = document_from_string '<<tigers#about>>', :header_footer => false
         | 
| 420 | 
            -
                assert_xpath '//a[@href="tigers.html#about"][text() = "tigers.html"]', doc. | 
| 489 | 
            +
                assert_xpath '//a[@href="tigers.html#about"][text() = "tigers.html"]', doc.convert, 1
         | 
| 421 490 | 
             
              end
         | 
| 422 491 |  | 
| 423 492 | 
             
              test 'xref using angled bracket syntax with path, fragment and text' do
         | 
| 424 493 | 
             
                doc = document_from_string '<<tigers#about,About Tigers>>', :header_footer => false
         | 
| 425 | 
            -
                assert_xpath '//a[@href="tigers.html#about"][text() = "About Tigers"]', doc. | 
| 494 | 
            +
                assert_xpath '//a[@href="tigers.html#about"][text() = "About Tigers"]', doc.convert, 1
         | 
| 426 495 | 
             
              end
         | 
| 427 496 |  | 
| 428 497 | 
             
              test 'xref using angled bracket syntax with path and custom relfilesuffix and outfilesuffix' do
         | 
| 429 498 | 
             
                attributes = {'relfileprefix' => '../', 'outfilesuffix' => '/'}
         | 
| 430 499 | 
             
                doc = document_from_string '<<tigers#about,About Tigers>>', :header_footer => false, :attributes => attributes
         | 
| 431 | 
            -
                assert_xpath '//a[@href="../tigers/#about"][text() = "About Tigers"]', doc. | 
| 500 | 
            +
                assert_xpath '//a[@href="../tigers/#about"][text() = "About Tigers"]', doc.convert, 1
         | 
| 501 | 
            +
              end
         | 
| 502 | 
            +
             | 
| 503 | 
            +
              test 'xref using angled bracket syntax with path and custom relfilesuffix' do
         | 
| 504 | 
            +
                attributes = { 'relfilesuffix' => '/' }
         | 
| 505 | 
            +
                doc = document_from_string '<<tigers#about,About Tigers>>', :header_footer => false, :attributes => attributes
         | 
| 506 | 
            +
                assert_xpath '//a[@href="tigers/#about"][text() = "About Tigers"]', doc.convert, 1
         | 
| 432 507 | 
             
              end
         | 
| 433 508 |  | 
| 434 509 | 
             
              test 'xref using angled bracket syntax with path which has been included in this document' do
         | 
| 435 | 
            -
                 | 
| 436 | 
            -
             | 
| 437 | 
            -
             | 
| 510 | 
            +
                using_memory_logger do |logger|
         | 
| 511 | 
            +
                  in_verbose_mode do
         | 
| 512 | 
            +
                    doc = document_from_string '<<tigers#about,About Tigers>>', :header_footer => false
         | 
| 513 | 
            +
                    doc.catalog[:includes]['tigers'] = true
         | 
| 514 | 
            +
                    output = doc.convert
         | 
| 515 | 
            +
                    assert_xpath '//a[@href="#about"][text() = "About Tigers"]', output, 1
         | 
| 516 | 
            +
                    assert_message logger, :WARN, 'invalid reference: about'
         | 
| 517 | 
            +
                  end
         | 
| 518 | 
            +
                end
         | 
| 438 519 | 
             
              end
         | 
| 439 520 |  | 
| 440 521 | 
             
              test 'xref using angled bracket syntax with nested path which has been included in this document' do
         | 
| 441 | 
            -
                 | 
| 442 | 
            -
             | 
| 443 | 
            -
             | 
| 522 | 
            +
                using_memory_logger do |logger|
         | 
| 523 | 
            +
                  in_verbose_mode do
         | 
| 524 | 
            +
                    doc = document_from_string '<<part1/tigers#about,About Tigers>>', :header_footer => false
         | 
| 525 | 
            +
                    doc.catalog[:includes]['part1/tigers'] = true
         | 
| 526 | 
            +
                    output = doc.convert
         | 
| 527 | 
            +
                    assert_xpath '//a[@href="#about"][text() = "About Tigers"]', output, 1
         | 
| 528 | 
            +
                    assert_message logger, :WARN, 'invalid reference: about'
         | 
| 529 | 
            +
                  end
         | 
| 530 | 
            +
                end
         | 
| 444 531 | 
             
              end
         | 
| 445 532 |  | 
| 446 533 | 
             
              test 'xref using angled bracket syntax inline with text' do
         | 
| @@ -496,7 +583,7 @@ A summary of the first lesson. | |
| 496 583 | 
             
              test 'xref using macro syntax' do
         | 
| 497 584 | 
             
                doc = document_from_string 'xref:tigers[]'
         | 
| 498 585 | 
             
                doc.register :refs, ['tigers', (Asciidoctor::Inline.new doc, :anchor, '[tigers]', :type => :ref, :target => 'tigers'), '[tigers]']
         | 
| 499 | 
            -
                assert_xpath '//a[@href="#tigers"][text() = "[tigers]"]', doc. | 
| 586 | 
            +
                assert_xpath '//a[@href="#tigers"][text() = "[tigers]"]', doc.convert, 1
         | 
| 500 587 | 
             
              end
         | 
| 501 588 |  | 
| 502 589 | 
             
              test 'multiple xref macros with implicit text in single line' do
         | 
| @@ -517,7 +604,7 @@ This document has two sections, xref:sect-a[] and xref:sect-b[]. | |
| 517 604 | 
             
              test 'xref using macro syntax with explicit hash' do
         | 
| 518 605 | 
             
                doc = document_from_string 'xref:#tigers[]'
         | 
| 519 606 | 
             
                doc.register :refs, ['tigers', (Asciidoctor::Inline.new doc, :anchor, 'Tigers', :type => :ref, :target => 'tigers'), 'Tigers']
         | 
| 520 | 
            -
                assert_xpath '//a[@href="#tigers"][text() = "Tigers"]', doc. | 
| 607 | 
            +
                assert_xpath '//a[@href="#tigers"][text() = "Tigers"]', doc.convert, 1
         | 
| 521 608 | 
             
              end
         | 
| 522 609 |  | 
| 523 610 | 
             
              test 'xref using macro syntax with label' do
         | 
| @@ -552,14 +639,24 @@ tigers]? | |
| 552 639 | 
             
                assert_xpath %{//a[@href="#tigers"][normalize-space(text()) = "about tigers"]}, render_string(input), 1
         | 
| 553 640 | 
             
              end
         | 
| 554 641 |  | 
| 555 | 
            -
              test 'xref using macro syntax with text that  | 
| 642 | 
            +
              test 'xref using macro syntax with text that ends with an escaped closing bracket' do
         | 
| 556 643 | 
             
                input = <<-EOS
         | 
| 557 644 | 
             
            xref:tigers[[tigers\\]]
         | 
| 558 645 |  | 
| 559 646 | 
             
            [#tigers]
         | 
| 560 647 | 
             
            == Tigers
         | 
| 561 648 | 
             
                EOS
         | 
| 562 | 
            -
                assert_xpath '//a[@href="#tigers"][text() = "[tigers]"]',  | 
| 649 | 
            +
                assert_xpath '//a[@href="#tigers"][text() = "[tigers]"]', render_embedded_string(input), 1
         | 
| 650 | 
            +
              end
         | 
| 651 | 
            +
             | 
| 652 | 
            +
              test 'xref using macro syntax with text that contains an escaped closing bracket' do
         | 
| 653 | 
            +
                input = <<-EOS
         | 
| 654 | 
            +
            xref:tigers[[tigers\\] are cats]
         | 
| 655 | 
            +
             | 
| 656 | 
            +
            [#tigers]
         | 
| 657 | 
            +
            == Tigers
         | 
| 658 | 
            +
                EOS
         | 
| 659 | 
            +
                assert_xpath '//a[@href="#tigers"][text() = "[tigers] are cats"]', render_embedded_string(input), 1
         | 
| 563 660 | 
             
              end
         | 
| 564 661 |  | 
| 565 662 | 
             
              test 'unescapes square bracket in reftext used by xref' do
         | 
| @@ -574,7 +671,7 @@ see <<foo>>' | |
| 574 671 | 
             
              test 'xref using invalid macro syntax does not create link' do
         | 
| 575 672 | 
             
                doc = document_from_string 'xref:tigers'
         | 
| 576 673 | 
             
                doc.register :refs, ['tigers', (Asciidoctor::Inline.new doc, :anchor, 'Tigers', :type => :ref, :target => 'tigers'), 'Tigers']
         | 
| 577 | 
            -
                assert_xpath '//a', doc. | 
| 674 | 
            +
                assert_xpath '//a', doc.convert, 0
         | 
| 578 675 | 
             
              end
         | 
| 579 676 |  | 
| 580 677 | 
             
              test 'should warn and create link if verbose flag is set and reference is not found' do
         | 
| @@ -586,14 +683,111 @@ see <<foo>>' | |
| 586 683 |  | 
| 587 684 | 
             
            See <<foobaz>>.
         | 
| 588 685 | 
             
                EOS
         | 
| 589 | 
            -
                 | 
| 590 | 
            -
                   | 
| 591 | 
            -
             | 
| 592 | 
            -
             | 
| 593 | 
            -
             | 
| 594 | 
            -
                   | 
| 595 | 
            -
                 | 
| 596 | 
            -
             | 
| 686 | 
            +
                using_memory_logger do |logger|
         | 
| 687 | 
            +
                  in_verbose_mode do
         | 
| 688 | 
            +
                    output = render_embedded_string input
         | 
| 689 | 
            +
                    assert_xpath '//a[@href="#foobaz"][text() = "[foobaz]"]', output, 1
         | 
| 690 | 
            +
                    assert_message logger, :WARN, 'invalid reference: foobaz'
         | 
| 691 | 
            +
                  end
         | 
| 692 | 
            +
                end
         | 
| 693 | 
            +
              end
         | 
| 694 | 
            +
             | 
| 695 | 
            +
              test 'should warn and create link if verbose flag is set and reference using # notation is not found' do
         | 
| 696 | 
            +
                input = <<-EOS
         | 
| 697 | 
            +
            [#foobar]
         | 
| 698 | 
            +
            == Foobar
         | 
| 699 | 
            +
             | 
| 700 | 
            +
            == Section B
         | 
| 701 | 
            +
             | 
| 702 | 
            +
            See <<#foobaz>>.
         | 
| 703 | 
            +
                EOS
         | 
| 704 | 
            +
                using_memory_logger do |logger|
         | 
| 705 | 
            +
                  in_verbose_mode do
         | 
| 706 | 
            +
                    output = render_embedded_string input
         | 
| 707 | 
            +
                    assert_xpath '//a[@href="#foobaz"][text() = "[foobaz]"]', output, 1
         | 
| 708 | 
            +
                    assert_message logger, :WARN, 'invalid reference: foobaz'
         | 
| 709 | 
            +
                  end
         | 
| 710 | 
            +
                end
         | 
| 711 | 
            +
              end
         | 
| 712 | 
            +
             | 
| 713 | 
            +
              test 'should produce an internal anchor from an inter-document xref to file included into current file' do
         | 
| 714 | 
            +
                input = <<-'EOS'
         | 
| 715 | 
            +
            = Book Title
         | 
| 716 | 
            +
            :doctype: book
         | 
| 717 | 
            +
             | 
| 718 | 
            +
            [#ch1]
         | 
| 719 | 
            +
            == Chapter 1
         | 
| 720 | 
            +
             | 
| 721 | 
            +
            So it begins.
         | 
| 722 | 
            +
             | 
| 723 | 
            +
            Read <<other-chapters.adoc#ch2>> to find out what happens next!
         | 
| 724 | 
            +
             | 
| 725 | 
            +
            include::other-chapters.adoc[]
         | 
| 726 | 
            +
                EOS
         | 
| 727 | 
            +
             | 
| 728 | 
            +
                doc = document_from_string input, :safe => :safe, :base_dir => fixturedir
         | 
| 729 | 
            +
                assert doc.catalog[:includes].key?('other-chapters')
         | 
| 730 | 
            +
                assert doc.catalog[:includes]['other-chapters']
         | 
| 731 | 
            +
                output = doc.convert
         | 
| 732 | 
            +
                assert_xpath '//a[@href="#ch2"][text()="Chapter 2"]', output, 1
         | 
| 733 | 
            +
              end
         | 
| 734 | 
            +
             | 
| 735 | 
            +
              test 'should produce an internal anchor from an inter-document xref to file included entirely into current file using tags' do
         | 
| 736 | 
            +
                input = <<-'EOS'
         | 
| 737 | 
            +
            = Book Title
         | 
| 738 | 
            +
            :doctype: book
         | 
| 739 | 
            +
             | 
| 740 | 
            +
            [#ch1]
         | 
| 741 | 
            +
            == Chapter 1
         | 
| 742 | 
            +
             | 
| 743 | 
            +
            So it begins.
         | 
| 744 | 
            +
             | 
| 745 | 
            +
            Read <<other-chapters.adoc#ch2>> to find out what happens next!
         | 
| 746 | 
            +
             | 
| 747 | 
            +
            include::other-chapters.adoc[tags=**]
         | 
| 748 | 
            +
                EOS
         | 
| 749 | 
            +
             | 
| 750 | 
            +
                output = render_embedded_string input, :safe => :safe, :base_dir => fixturedir
         | 
| 751 | 
            +
                assert_xpath '//a[@href="#ch2"][text()="Chapter 2"]', output, 1
         | 
| 752 | 
            +
              end
         | 
| 753 | 
            +
             | 
| 754 | 
            +
              test 'should not produce an internal anchor for inter-document xref to file partially included into current file' do
         | 
| 755 | 
            +
                input = <<-'EOS'
         | 
| 756 | 
            +
            = Book Title
         | 
| 757 | 
            +
            :doctype: book
         | 
| 758 | 
            +
             | 
| 759 | 
            +
            [#ch1]
         | 
| 760 | 
            +
            == Chapter 1
         | 
| 761 | 
            +
             | 
| 762 | 
            +
            So it begins.
         | 
| 763 | 
            +
             | 
| 764 | 
            +
            Read <<other-chapters.adoc#ch2,the next chapter>> to find out what happens next!
         | 
| 765 | 
            +
             | 
| 766 | 
            +
            include::other-chapters.adoc[tags=ch2]
         | 
| 767 | 
            +
                EOS
         | 
| 768 | 
            +
             | 
| 769 | 
            +
                doc = document_from_string input, :safe => :safe, :base_dir => fixturedir
         | 
| 770 | 
            +
                assert doc.catalog[:includes].key?('other-chapters')
         | 
| 771 | 
            +
                refute doc.catalog[:includes]['other-chapters']
         | 
| 772 | 
            +
                output = doc.convert
         | 
| 773 | 
            +
                assert_xpath '//a[@href="other-chapters.html#ch2"][text()="the next chapter"]', output, 1
         | 
| 774 | 
            +
              end
         | 
| 775 | 
            +
             | 
| 776 | 
            +
              test 'should warn and create link if debug mode is enabled, inter-document xref points to current doc, and reference not found' do
         | 
| 777 | 
            +
                input = <<-EOS
         | 
| 778 | 
            +
            [#foobar]
         | 
| 779 | 
            +
            == Foobar
         | 
| 780 | 
            +
             | 
| 781 | 
            +
            == Section B
         | 
| 782 | 
            +
             | 
| 783 | 
            +
            See <<test.adoc#foobaz>>.
         | 
| 784 | 
            +
                EOS
         | 
| 785 | 
            +
                using_memory_logger do |logger|
         | 
| 786 | 
            +
                  in_verbose_mode do
         | 
| 787 | 
            +
                    output = render_embedded_string input, :attributes => { 'docname' => 'test' }
         | 
| 788 | 
            +
                    assert_xpath '//a[@href="#foobaz"][text() = "[foobaz]"]', output, 1
         | 
| 789 | 
            +
                    assert_message logger, :WARN, 'invalid reference: foobaz'
         | 
| 790 | 
            +
                  end
         | 
| 597 791 | 
             
                end
         | 
| 598 792 | 
             
              end
         | 
| 599 793 |  |