asciidoctor 1.5.4 → 1.5.5
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of asciidoctor might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.adoc +72 -5
- data/CONTRIBUTING.adoc +3 -3
- data/Gemfile +23 -0
- data/README-fr.adoc +416 -0
- data/README-jp.adoc +395 -0
- data/README-zh_CN.adoc +414 -0
- data/README.adoc +134 -72
- data/asciidoctor.gemspec +49 -0
- data/data/locale/attributes.adoc +470 -0
- data/data/stylesheets/asciidoctor-default.css +6 -5
- data/lib/asciidoctor.rb +22 -19
- data/lib/asciidoctor/abstract_block.rb +20 -10
- data/lib/asciidoctor/abstract_node.rb +3 -14
- data/lib/asciidoctor/cli/invoker.rb +5 -4
- data/lib/asciidoctor/cli/options.rb +1 -1
- data/lib/asciidoctor/converter/docbook5.rb +1 -1
- data/lib/asciidoctor/converter/factory.rb +1 -5
- data/lib/asciidoctor/converter/html5.rb +36 -31
- data/lib/asciidoctor/converter/manpage.rb +14 -9
- data/lib/asciidoctor/converter/template.rb +8 -4
- data/lib/asciidoctor/core_ext.rb +7 -6
- data/lib/asciidoctor/core_ext/{string → 1.8.7/string}/chr.rb +1 -1
- data/lib/asciidoctor/core_ext/1.8.7/string/limit.rb +28 -0
- data/lib/asciidoctor/core_ext/{symbol → 1.8.7/symbol}/length.rb +1 -1
- data/lib/asciidoctor/core_ext/nil_or_empty.rb +23 -0
- data/lib/asciidoctor/core_ext/string/limit.rb +10 -0
- data/lib/asciidoctor/document.rb +33 -26
- data/lib/asciidoctor/extensions.rb +16 -16
- data/lib/asciidoctor/helpers.rb +1 -1
- data/lib/asciidoctor/list.rb +3 -0
- data/lib/asciidoctor/parser.rb +47 -43
- data/lib/asciidoctor/path_resolver.rb +3 -1
- data/lib/asciidoctor/reader.rb +15 -14
- data/lib/asciidoctor/section.rb +2 -2
- data/lib/asciidoctor/stylesheets.rb +2 -1
- data/lib/asciidoctor/substitutors.rb +44 -46
- data/lib/asciidoctor/table.rb +41 -38
- data/lib/asciidoctor/version.rb +1 -1
- data/man/asciidoctor.1 +11 -4
- data/man/asciidoctor.adoc +7 -1
- data/test/attributes_test.rb +52 -0
- data/test/blocks_test.rb +8 -8
- data/test/document_test.rb +13 -1
- data/test/extensions_test.rb +38 -0
- data/test/invoker_test.rb +15 -0
- data/test/lists_test.rb +78 -53
- data/test/manpage_test.rb +15 -0
- data/test/paths_test.rb +3 -0
- data/test/reader_test.rb +2 -2
- data/test/sections_test.rb +10 -0
- data/test/substitutions_test.rb +12 -6
- data/test/tables_test.rb +76 -2
- metadata +16 -45
- data/lib/asciidoctor/core_ext/object/nil_or_empty.rb +0 -23
- data/test/fixtures/asciidoc_index.txt +0 -521
- data/test/fixtures/basic-docinfo-footer.html +0 -6
- data/test/fixtures/basic-docinfo-footer.xml +0 -8
- data/test/fixtures/basic-docinfo.html +0 -1
- data/test/fixtures/basic-docinfo.xml +0 -4
- data/test/fixtures/basic.asciidoc +0 -5
- data/test/fixtures/chapter-a.adoc +0 -3
- data/test/fixtures/child-include.adoc +0 -5
- data/test/fixtures/circle.svg +0 -8
- data/test/fixtures/custom-backends/erb/html5/block_paragraph.html.erb +0 -6
- data/test/fixtures/custom-backends/haml/docbook45/block_paragraph.xml.haml +0 -6
- data/test/fixtures/custom-backends/haml/html5-tweaks/block_paragraph.html.haml +0 -1
- data/test/fixtures/custom-backends/haml/html5/block_paragraph.html.haml +0 -3
- data/test/fixtures/custom-backends/haml/html5/block_sidebar.html.haml +0 -5
- data/test/fixtures/custom-backends/slim/docbook45/block_paragraph.xml.slim +0 -6
- data/test/fixtures/custom-backends/slim/html5/block_paragraph.html.slim +0 -3
- data/test/fixtures/custom-backends/slim/html5/block_sidebar.html.slim +0 -5
- data/test/fixtures/custom-docinfodir/basic-docinfo.html +0 -1
- data/test/fixtures/custom-docinfodir/docinfo.html +0 -1
- data/test/fixtures/docinfo-footer.html +0 -1
- data/test/fixtures/docinfo-footer.xml +0 -9
- data/test/fixtures/docinfo.html +0 -1
- data/test/fixtures/docinfo.xml +0 -3
- data/test/fixtures/dot.gif +0 -0
- data/test/fixtures/encoding.asciidoc +0 -13
- data/test/fixtures/grandchild-include.adoc +0 -3
- data/test/fixtures/hello-asciidoctor.pdf +0 -0
- data/test/fixtures/include-file.asciidoc +0 -24
- data/test/fixtures/include-file.xml +0 -5
- data/test/fixtures/master.adoc +0 -5
- data/test/fixtures/parent-include-restricted.adoc +0 -5
- data/test/fixtures/parent-include.adoc +0 -5
- data/test/fixtures/sample.asciidoc +0 -26
- data/test/fixtures/stylesheets/custom.css +0 -3
- data/test/fixtures/subs-docinfo.html +0 -2
- data/test/fixtures/subs.adoc +0 -7
- data/test/fixtures/tip.gif +0 -0
- data/test/test_helper.rb +0 -399
data/test/blocks_test.rb
CHANGED
@@ -1523,10 +1523,10 @@ image::circle.svg[Tiger,100]
|
|
1523
1523
|
EOS
|
1524
1524
|
|
1525
1525
|
output = render_embedded_string input, :safe => Asciidoctor::SafeMode::SERVER, :attributes => { 'docdir' => ::File.dirname(__FILE__) }
|
1526
|
-
assert_match(/<svg
|
1527
|
-
refute_match(/<svg
|
1528
|
-
refute_match(/<svg
|
1529
|
-
refute_match(/<svg
|
1526
|
+
assert_match(/<svg\s[^>]*width="100px"[^>]*>/, output, 1)
|
1527
|
+
refute_match(/<svg\s[^>]*width="500px"[^>]*>/, output)
|
1528
|
+
refute_match(/<svg\s[^>]*height="500px"[^>]*>/, output)
|
1529
|
+
refute_match(/<svg\s[^>]*style="width:500px;height:500px"[^>]*>/, output)
|
1530
1530
|
end
|
1531
1531
|
|
1532
1532
|
test 'renders inline SVG image using svg element even when data-uri is set' do
|
@@ -1539,7 +1539,7 @@ image::circle.svg[Tiger,100]
|
|
1539
1539
|
EOS
|
1540
1540
|
|
1541
1541
|
output = render_embedded_string input, :safe => Asciidoctor::SafeMode::SERVER, :attributes => { 'docdir' => ::File.dirname(__FILE__) }
|
1542
|
-
assert_match(/<svg
|
1542
|
+
assert_match(/<svg\s[^>]*width="100px">/, output, 1)
|
1543
1543
|
end
|
1544
1544
|
|
1545
1545
|
test 'renders alt text for inline svg element if svg cannot be read' do
|
@@ -2162,7 +2162,7 @@ You can use icons for admonitions by setting the 'icons' attribute.
|
|
2162
2162
|
EOS
|
2163
2163
|
|
2164
2164
|
output = render_string input, :safe => Asciidoctor::SafeMode::SERVER
|
2165
|
-
assert_css 'html > head > link[rel="stylesheet"][href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.
|
2165
|
+
assert_css 'html > head > link[rel="stylesheet"][href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css"]', output, 1
|
2166
2166
|
assert_xpath '//*[@class="admonitionblock tip"]//*[@class="icon"]/i[@class="fa icon-tip"]', output, 1
|
2167
2167
|
end
|
2168
2168
|
|
@@ -2193,7 +2193,7 @@ puts "AsciiDoc, FTW!"
|
|
2193
2193
|
EOS
|
2194
2194
|
|
2195
2195
|
output = render_string input, :safe => Asciidoctor::SafeMode::SAFE
|
2196
|
-
assert_css 'html > head > link[rel="stylesheet"][href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.
|
2196
|
+
assert_css 'html > head > link[rel="stylesheet"][href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css"]', output, 1
|
2197
2197
|
assert_css 'html > body > script[src="http://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.9.1/highlight.min.js"]', output, 1
|
2198
2198
|
end
|
2199
2199
|
|
@@ -2210,7 +2210,7 @@ puts "AsciiDoc, FTW!"
|
|
2210
2210
|
EOS
|
2211
2211
|
|
2212
2212
|
output = render_string input, :safe => Asciidoctor::SafeMode::SAFE
|
2213
|
-
assert_css 'html > head > link[rel="stylesheet"][href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.
|
2213
|
+
assert_css 'html > head > link[rel="stylesheet"][href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css"]', output, 1
|
2214
2214
|
assert_css 'html > body > script[src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.9.1/highlight.min.js"]', output, 1
|
2215
2215
|
end
|
2216
2216
|
end
|
data/test/document_test.rb
CHANGED
@@ -520,6 +520,18 @@ term without description::
|
|
520
520
|
assert_xpath '/html/body/*[@id="header"]/h1[text() = "Document Title"]', output, 1
|
521
521
|
end
|
522
522
|
|
523
|
+
test 'lines in output should be separated by line feed' do
|
524
|
+
sample_input_path = fixture_path('sample.asciidoc')
|
525
|
+
|
526
|
+
output = Asciidoctor.convert_file sample_input_path, :header_footer => true, :to_file => false
|
527
|
+
assert !output.empty?
|
528
|
+
lines = output.split("\n")
|
529
|
+
assert lines.size == output.split(/\r\n|\r|\n/).size
|
530
|
+
raw_lengths = lines.map(&:length)
|
531
|
+
trimmed_lengths = lines.map {|line| line.rstrip.length }
|
532
|
+
assert raw_lengths == trimmed_lengths
|
533
|
+
end
|
534
|
+
|
523
535
|
test 'should accept attributes as array' do
|
524
536
|
sample_input_path = fixture_path('sample.asciidoc')
|
525
537
|
output = Asciidoctor.convert_file sample_input_path, :attributes => %w(sectnums idprefix idseparator=-), :to_file => false
|
@@ -1674,7 +1686,7 @@ image::tiger.png[]
|
|
1674
1686
|
|===
|
1675
1687
|
|
1676
1688
|
[horizontal, labelwidth="25%", itemwidth="75%"]
|
1677
|
-
term::
|
1689
|
+
term:: description
|
1678
1690
|
|
1679
1691
|
NOTE: note
|
1680
1692
|
|
data/test/extensions_test.rb
CHANGED
@@ -665,6 +665,44 @@ content
|
|
665
665
|
end
|
666
666
|
end
|
667
667
|
|
668
|
+
test 'parse_content should not share attributes between parsed blocks' do
|
669
|
+
begin
|
670
|
+
Asciidoctor::Extensions.register do
|
671
|
+
block do
|
672
|
+
named :wrap
|
673
|
+
on_context :open
|
674
|
+
process do |parent, reader, attrs|
|
675
|
+
wrap = create_open_block parent, nil, attrs
|
676
|
+
parse_content wrap, reader.read_lines
|
677
|
+
end
|
678
|
+
end
|
679
|
+
end
|
680
|
+
input = <<-EOS
|
681
|
+
[wrap]
|
682
|
+
--
|
683
|
+
[foo=bar]
|
684
|
+
====
|
685
|
+
content
|
686
|
+
====
|
687
|
+
|
688
|
+
[baz=qux]
|
689
|
+
====
|
690
|
+
content
|
691
|
+
====
|
692
|
+
--
|
693
|
+
EOS
|
694
|
+
doc = document_from_string input
|
695
|
+
assert_equal 1, doc.blocks.size
|
696
|
+
wrap = doc.blocks[0]
|
697
|
+
assert_equal 2, wrap.blocks.size
|
698
|
+
assert_equal 2, wrap.blocks[0].attributes.size
|
699
|
+
assert_equal 2, wrap.blocks[1].attributes.size
|
700
|
+
assert_nil wrap.blocks[1].attributes['foo']
|
701
|
+
ensure
|
702
|
+
Asciidoctor::Extensions.unregister_all
|
703
|
+
end
|
704
|
+
end
|
705
|
+
|
668
706
|
test 'should add docinfo to document' do
|
669
707
|
input = <<-EOS
|
670
708
|
= Document Title
|
data/test/invoker_test.rb
CHANGED
@@ -550,4 +550,19 @@ context 'Invoker' do
|
|
550
550
|
assert_match(/Total time/, error)
|
551
551
|
end
|
552
552
|
|
553
|
+
test 'should use SOURCE_DATE_EPOCH as modified time of input file and local time' do
|
554
|
+
old_source_date_epoch = ENV.delete 'SOURCE_DATE_EPOCH'
|
555
|
+
begin
|
556
|
+
ENV['SOURCE_DATE_EPOCH'] = '1234123412'
|
557
|
+
sample_filepath = File.expand_path(File.join(File.dirname(__FILE__), 'fixtures', 'sample.asciidoc'))
|
558
|
+
invoker = invoke_cli_to_buffer %w(-o /dev/null), sample_filepath
|
559
|
+
doc = invoker.document
|
560
|
+
assert_equal '2009-02-08', (doc.attr 'docdate')
|
561
|
+
assert_match(/2009-02-08 20:03:32 (GMT|UTC)/, (doc.attr 'docdatetime'))
|
562
|
+
assert_equal '2009-02-08', (doc.attr 'localdate')
|
563
|
+
assert_match(/2009-02-08 20:03:32 (GMT|UTC)/, (doc.attr 'localdatetime'))
|
564
|
+
ensure
|
565
|
+
ENV['SOURCE_DATE_EPOCH'] = old_source_date_epoch if old_source_date_epoch
|
566
|
+
end
|
567
|
+
end
|
553
568
|
end
|
data/test/lists_test.rb
CHANGED
@@ -258,6 +258,18 @@ second wrapped line
|
|
258
258
|
assert !output.include?('* Foo')
|
259
259
|
end
|
260
260
|
|
261
|
+
test 'a list item that starts with a sequence of list markers characters should not match a nested list' do
|
262
|
+
input = <<-EOS
|
263
|
+
* first item
|
264
|
+
*. normal text
|
265
|
+
EOS
|
266
|
+
|
267
|
+
output = render_embedded_string input
|
268
|
+
assert_css 'ul', output, 1
|
269
|
+
assert_css 'ul li', output, 1
|
270
|
+
assert_xpath "//ul/li/p[text()='first item\n*. normal text']", output, 1
|
271
|
+
end
|
272
|
+
|
261
273
|
test 'a list item for a different list terminates indented paragraph for text of list item' do
|
262
274
|
input = <<-EOS
|
263
275
|
== Example 1
|
@@ -1472,11 +1484,11 @@ attached paragraph
|
|
1472
1484
|
input = <<-EOS
|
1473
1485
|
* item 1
|
1474
1486
|
|
1475
|
-
term a::
|
1487
|
+
term a:: description a
|
1476
1488
|
+
|
1477
1489
|
attached paragraph
|
1478
1490
|
|
1479
|
-
term b::
|
1491
|
+
term b:: description b
|
1480
1492
|
+
|
1481
1493
|
attached paragraph
|
1482
1494
|
|
@@ -1595,6 +1607,19 @@ List
|
|
1595
1607
|
assert_css '.olist ol.loweralpha', output, 1
|
1596
1608
|
end
|
1597
1609
|
|
1610
|
+
test 'should set reversed attribute on list if reversed option is set' do
|
1611
|
+
input = <<-EOS
|
1612
|
+
[%reversed, start=3]
|
1613
|
+
. three
|
1614
|
+
. two
|
1615
|
+
. one
|
1616
|
+
. blast off!
|
1617
|
+
EOS
|
1618
|
+
|
1619
|
+
output = render_embedded_string input
|
1620
|
+
assert_css 'ol[reversed][start="3"]', output, 1
|
1621
|
+
end
|
1622
|
+
|
1598
1623
|
test 'should represent implicit role attribute as style class' do
|
1599
1624
|
input = <<-EOS
|
1600
1625
|
[.dry]
|
@@ -1952,7 +1977,7 @@ def2
|
|
1952
1977
|
input = <<-EOS
|
1953
1978
|
term::
|
1954
1979
|
alt term::
|
1955
|
-
|
1980
|
+
description
|
1956
1981
|
|
1957
1982
|
last::
|
1958
1983
|
EOS
|
@@ -2111,7 +2136,7 @@ anotherterm:: def
|
|
2111
2136
|
term::
|
2112
2137
|
+
|
2113
2138
|
--
|
2114
|
-
Open block as
|
2139
|
+
Open block as description of term.
|
2115
2140
|
|
2116
2141
|
And some more detail...
|
2117
2142
|
--
|
@@ -2201,7 +2226,7 @@ term2:: def
|
|
2201
2226
|
assert_xpath '((//dl/dd)[1]//ul)[1]//ul', output, 1
|
2202
2227
|
end
|
2203
2228
|
|
2204
|
-
test "should only grab one line following last item if item has no inline
|
2229
|
+
test "should only grab one line following last item if item has no inline description" do
|
2205
2230
|
input = <<-EOS
|
2206
2231
|
term1::
|
2207
2232
|
|
@@ -2225,7 +2250,7 @@ Another new paragraph
|
|
2225
2250
|
assert_xpath '(//*[@class="dlist"]/following-sibling::*[@class="paragraph"])[2]/p[text() = "Another new paragraph"]', output, 1
|
2226
2251
|
end
|
2227
2252
|
|
2228
|
-
test "should only grab one literal line following last item if item has no inline
|
2253
|
+
test "should only grab one literal line following last item if item has no inline description" do
|
2229
2254
|
input = <<-EOS
|
2230
2255
|
term1::
|
2231
2256
|
|
@@ -2509,7 +2534,7 @@ term 2:: def 2
|
|
2509
2534
|
[glossary]
|
2510
2535
|
term::
|
2511
2536
|
alt term::
|
2512
|
-
|
2537
|
+
description
|
2513
2538
|
|
2514
2539
|
last::
|
2515
2540
|
EOS
|
@@ -2524,11 +2549,11 @@ last::
|
|
2524
2549
|
test 'should render horizontal list with proper markup' do
|
2525
2550
|
input = <<-EOS
|
2526
2551
|
[horizontal]
|
2527
|
-
first term::
|
2552
|
+
first term:: description
|
2528
2553
|
+
|
2529
2554
|
more detail
|
2530
2555
|
|
2531
|
-
second term::
|
2556
|
+
second term:: description
|
2532
2557
|
EOS
|
2533
2558
|
output = render_embedded_string input
|
2534
2559
|
assert_css '.hdlist', output, 1
|
@@ -2541,11 +2566,11 @@ second term:: definition
|
|
2541
2566
|
assert_xpath '/*[@class="hdlist"]/table/tr[1]/td[@class="hdlist2"]/p', output, 1
|
2542
2567
|
assert_xpath '/*[@class="hdlist"]/table/tr[1]/td[@class="hdlist2"]/p/following-sibling::*[@class="paragraph"]', output, 1
|
2543
2568
|
assert_xpath '((//tr)[1]/td)[1][normalize-space(text())="first term"]', output, 1
|
2544
|
-
assert_xpath '((//tr)[1]/td)[2]/p[normalize-space(text())="
|
2569
|
+
assert_xpath '((//tr)[1]/td)[2]/p[normalize-space(text())="description"]', output, 1
|
2545
2570
|
|
2546
2571
|
assert_xpath '/*[@class="hdlist"]/table/tr[2]/td', output, 2
|
2547
2572
|
assert_xpath '((//tr)[2]/td)[1][normalize-space(text())="second term"]', output, 1
|
2548
|
-
assert_xpath '((//tr)[2]/td)[2]/p[normalize-space(text())="
|
2573
|
+
assert_xpath '((//tr)[2]/td)[2]/p[normalize-space(text())="description"]', output, 1
|
2549
2574
|
end
|
2550
2575
|
|
2551
2576
|
test 'should set col widths of item and label if specified' do
|
@@ -2594,7 +2619,7 @@ term:: def
|
|
2594
2619
|
[horizontal]
|
2595
2620
|
term::
|
2596
2621
|
alt term::
|
2597
|
-
|
2622
|
+
description
|
2598
2623
|
|
2599
2624
|
last::
|
2600
2625
|
EOS
|
@@ -2612,7 +2637,7 @@ last::
|
|
2612
2637
|
[horizontal]
|
2613
2638
|
term::
|
2614
2639
|
alt term::
|
2615
|
-
|
2640
|
+
description
|
2616
2641
|
|
2617
2642
|
last::
|
2618
2643
|
EOS
|
@@ -2628,11 +2653,11 @@ last::
|
|
2628
2653
|
input = <<-EOS
|
2629
2654
|
.Terms
|
2630
2655
|
[horizontal]
|
2631
|
-
first term::
|
2656
|
+
first term:: description
|
2632
2657
|
+
|
2633
2658
|
more detail
|
2634
2659
|
|
2635
|
-
second term::
|
2660
|
+
second term:: description
|
2636
2661
|
EOS
|
2637
2662
|
output = render_embedded_string input, :backend => 'docbook'
|
2638
2663
|
assert_xpath '/table', output, 1
|
@@ -3010,7 +3035,7 @@ term1::
|
|
3010
3035
|
assert_xpath '//*[@class="dlist"]//dd/p/following-sibling::*[@class="literalblock"]//pre[text()="literal"]', output, 2
|
3011
3036
|
end
|
3012
3037
|
|
3013
|
-
test 'folds text of subsequent line and appends following literal line offset by blank line as block if term has no inline
|
3038
|
+
test 'folds text of subsequent line and appends following literal line offset by blank line as block if term has no inline description' do
|
3014
3039
|
input = <<-EOS
|
3015
3040
|
== Lists
|
3016
3041
|
|
@@ -3030,7 +3055,7 @@ term2:: def2
|
|
3030
3055
|
assert_xpath '(//*[@class="dlist"]//dd)[1]/p/following-sibling::*[@class="literalblock"]//pre[text()="literal"]', output, 1
|
3031
3056
|
end
|
3032
3057
|
|
3033
|
-
test 'appends literal line attached by continuation as block if item has no inline
|
3058
|
+
test 'appends literal line attached by continuation as block if item has no inline description' do
|
3034
3059
|
input = <<-EOS
|
3035
3060
|
== Lists
|
3036
3061
|
|
@@ -3047,7 +3072,7 @@ term1::
|
|
3047
3072
|
assert_xpath '//*[@class="dlist"]//dd/*[@class="literalblock"]//pre[text()="literal"]', output, 1
|
3048
3073
|
end
|
3049
3074
|
|
3050
|
-
test 'appends literal line attached by continuation as block if item has no inline
|
3075
|
+
test 'appends literal line attached by continuation as block if item has no inline description followed by ruler' do
|
3051
3076
|
input = <<-EOS
|
3052
3077
|
== Lists
|
3053
3078
|
|
@@ -3067,7 +3092,7 @@ term1::
|
|
3067
3092
|
assert_xpath '//*[@class="dlist"]/following-sibling::hr', output, 1
|
3068
3093
|
end
|
3069
3094
|
|
3070
|
-
test 'appends line attached by continuation as block if item has no inline
|
3095
|
+
test 'appends line attached by continuation as block if item has no inline description followed by ruler' do
|
3071
3096
|
input = <<-EOS
|
3072
3097
|
== Lists
|
3073
3098
|
|
@@ -3087,7 +3112,7 @@ para
|
|
3087
3112
|
assert_xpath '//*[@class="dlist"]/following-sibling::hr', output, 1
|
3088
3113
|
end
|
3089
3114
|
|
3090
|
-
test 'appends line attached by continuation as block if item has no inline
|
3115
|
+
test 'appends line attached by continuation as block if item has no inline description followed by block' do
|
3091
3116
|
input = <<-EOS
|
3092
3117
|
== Lists
|
3093
3118
|
|
@@ -3134,7 +3159,7 @@ detached
|
|
3134
3159
|
assert_xpath '//*[@class="dlist"]/following-sibling::*[@class="literalblock"]//pre[text()="detached"]', output, 1
|
3135
3160
|
end
|
3136
3161
|
|
3137
|
-
test 'appends list if item has no inline
|
3162
|
+
test 'appends list if item has no inline description' do
|
3138
3163
|
input = <<-EOS
|
3139
3164
|
== Lists
|
3140
3165
|
|
@@ -3177,13 +3202,13 @@ term2:: def2
|
|
3177
3202
|
== Lists
|
3178
3203
|
|
3179
3204
|
label 1::
|
3180
|
-
|
3205
|
+
description 1
|
3181
3206
|
|
3182
3207
|
* one
|
3183
3208
|
* two
|
3184
3209
|
* three
|
3185
3210
|
label 2::
|
3186
|
-
|
3211
|
+
description 2
|
3187
3212
|
|
3188
3213
|
paragraph
|
3189
3214
|
EOS
|
@@ -3193,8 +3218,8 @@ paragraph
|
|
3193
3218
|
assert_xpath '(//*[@class="dlist"]//dt)[1][normalize-space(text())="label 1"]', output, 1
|
3194
3219
|
assert_xpath '(//*[@class="dlist"]//dt)[2][normalize-space(text())="label 2"]', output, 1
|
3195
3220
|
assert_css '.dlist dd', output, 2
|
3196
|
-
assert_xpath '(//*[@class="dlist"]//dd)[1]/p[text()="
|
3197
|
-
assert_xpath '(//*[@class="dlist"]//dd)[2]/p[text()="
|
3221
|
+
assert_xpath '(//*[@class="dlist"]//dd)[1]/p[text()="description 1"]', output, 1
|
3222
|
+
assert_xpath '(//*[@class="dlist"]//dd)[2]/p[text()="description 2"]', output, 1
|
3198
3223
|
assert_xpath '(//*[@class="dlist"]//dd)[1]/p/following-sibling::*[@class="ulist"]', output, 1
|
3199
3224
|
assert_xpath '(//*[@class="dlist"]//dd)[1]/p/following-sibling::*[@class="ulist"]//li', output, 3
|
3200
3225
|
assert_css '.dlist + .paragraph', output, 1
|
@@ -3205,13 +3230,13 @@ paragraph
|
|
3205
3230
|
== Lists
|
3206
3231
|
|
3207
3232
|
label 1::
|
3208
|
-
|
3233
|
+
description 1
|
3209
3234
|
+
|
3210
3235
|
* one
|
3211
3236
|
* two
|
3212
3237
|
* three
|
3213
3238
|
label 2::
|
3214
|
-
|
3239
|
+
description 2
|
3215
3240
|
|
3216
3241
|
paragraph
|
3217
3242
|
EOS
|
@@ -3221,8 +3246,8 @@ paragraph
|
|
3221
3246
|
assert_xpath '(//*[@class="dlist"]//dt)[1][normalize-space(text())="label 1"]', output, 1
|
3222
3247
|
assert_xpath '(//*[@class="dlist"]//dt)[2][normalize-space(text())="label 2"]', output, 1
|
3223
3248
|
assert_css '.dlist dd', output, 2
|
3224
|
-
assert_xpath '(//*[@class="dlist"]//dd)[1]/p[text()="
|
3225
|
-
assert_xpath '(//*[@class="dlist"]//dd)[2]/p[text()="
|
3249
|
+
assert_xpath '(//*[@class="dlist"]//dd)[1]/p[text()="description 1"]', output, 1
|
3250
|
+
assert_xpath '(//*[@class="dlist"]//dd)[2]/p[text()="description 2"]', output, 1
|
3226
3251
|
assert_xpath '(//*[@class="dlist"]//dd)[1]/p/following-sibling::*[@class="ulist"]', output, 1
|
3227
3252
|
assert_xpath '(//*[@class="dlist"]//dd)[1]/p/following-sibling::*[@class="ulist"]//li', output, 3
|
3228
3253
|
assert_css '.dlist + .paragraph', output, 1
|
@@ -3297,7 +3322,7 @@ notnestedterm:::
|
|
3297
3322
|
assert_xpath %(//*[@class="dlist"]//dd/*[@class="literalblock"]//pre[text()=" literal\nnotnestedterm:::"]), output, 2
|
3298
3323
|
end
|
3299
3324
|
|
3300
|
-
test 'line attached by continuation is appended as paragraph if term has no inline
|
3325
|
+
test 'line attached by continuation is appended as paragraph if term has no inline description' do
|
3301
3326
|
input = <<-EOS
|
3302
3327
|
== Lists
|
3303
3328
|
|
@@ -3318,7 +3343,7 @@ para
|
|
3318
3343
|
input = <<-EOS
|
3319
3344
|
term1:: def
|
3320
3345
|
+
|
3321
|
-
more
|
3346
|
+
more description
|
3322
3347
|
not a term::: def
|
3323
3348
|
EOS
|
3324
3349
|
|
@@ -3335,7 +3360,7 @@ not a term::: def
|
|
3335
3360
|
input = <<-EOS
|
3336
3361
|
term1:: def
|
3337
3362
|
+
|
3338
|
-
more
|
3363
|
+
more description
|
3339
3364
|
not a term:: def
|
3340
3365
|
EOS
|
3341
3366
|
|
@@ -3352,7 +3377,7 @@ not a term:: def
|
|
3352
3377
|
term1:: def
|
3353
3378
|
+
|
3354
3379
|
[quote]
|
3355
|
-
more
|
3380
|
+
more description
|
3356
3381
|
not a term::: def
|
3357
3382
|
EOS
|
3358
3383
|
|
@@ -3363,7 +3388,7 @@ not a term::: def
|
|
3363
3388
|
assert output.include?('not a term::: def')
|
3364
3389
|
end
|
3365
3390
|
|
3366
|
-
test 'appends line as paragraph if attached by continuation following blank line and line comment when term has no inline
|
3391
|
+
test 'appends line as paragraph if attached by continuation following blank line and line comment when term has no inline description' do
|
3367
3392
|
input = <<-EOS
|
3368
3393
|
== Lists
|
3369
3394
|
|
@@ -3382,7 +3407,7 @@ para
|
|
3382
3407
|
assert_xpath '//*[@class="dlist"]//dd/*[@class="paragraph"]/p[text()="para"]', output, 1
|
3383
3408
|
end
|
3384
3409
|
|
3385
|
-
test 'line attached by continuation offset by blank line is appended as paragraph if term has no inline
|
3410
|
+
test 'line attached by continuation offset by blank line is appended as paragraph if term has no inline description' do
|
3386
3411
|
input = <<-EOS
|
3387
3412
|
== Lists
|
3388
3413
|
|
@@ -3400,7 +3425,7 @@ para
|
|
3400
3425
|
assert_xpath '//*[@class="dlist"]//dd/*[@class="paragraph"]/p[text()="para"]', output, 1
|
3401
3426
|
end
|
3402
3427
|
|
3403
|
-
test 'delimited block breaks list even when term has no inline
|
3428
|
+
test 'delimited block breaks list even when term has no inline description' do
|
3404
3429
|
input = <<-EOS
|
3405
3430
|
== Lists
|
3406
3431
|
|
@@ -3417,7 +3442,7 @@ detached
|
|
3417
3442
|
assert_xpath '//*[@class="dlist"]/following-sibling::*[@class="exampleblock"]//p[text()="detached"]', output, 1
|
3418
3443
|
end
|
3419
3444
|
|
3420
|
-
test 'attribute line breaks list even when term has no inline
|
3445
|
+
test 'attribute line breaks list even when term has no inline description' do
|
3421
3446
|
input = <<-EOS
|
3422
3447
|
== Lists
|
3423
3448
|
|
@@ -3433,7 +3458,7 @@ detached
|
|
3433
3458
|
assert_xpath '//*[@class="dlist"]/following-sibling::*[@class="verseblock"]/pre[text()="detached"]', output, 1
|
3434
3459
|
end
|
3435
3460
|
|
3436
|
-
test 'id line breaks list even when term has no inline
|
3461
|
+
test 'id line breaks list even when term has no inline description' do
|
3437
3462
|
input = <<-EOS
|
3438
3463
|
== Lists
|
3439
3464
|
|
@@ -3452,7 +3477,7 @@ detached
|
|
3452
3477
|
|
3453
3478
|
context 'Item with text inline' do
|
3454
3479
|
|
3455
|
-
test 'folds text from inline
|
3480
|
+
test 'folds text from inline description and subsequent line' do
|
3456
3481
|
input = <<-EOS
|
3457
3482
|
== Lists
|
3458
3483
|
|
@@ -3466,7 +3491,7 @@ continued
|
|
3466
3491
|
assert_xpath %(//*[@class="dlist"]//dd/p[text()="def1\ncontinued"]), output, 1
|
3467
3492
|
end
|
3468
3493
|
|
3469
|
-
test 'folds text from inline
|
3494
|
+
test 'folds text from inline description and subsequent lines' do
|
3470
3495
|
input = <<-EOS
|
3471
3496
|
== Lists
|
3472
3497
|
|
@@ -3481,7 +3506,7 @@ continued
|
|
3481
3506
|
assert_xpath %(//*[@class="dlist"]//dd/p[text()="def1\ncontinued\ncontinued"]), output, 1
|
3482
3507
|
end
|
3483
3508
|
|
3484
|
-
test 'folds text from inline
|
3509
|
+
test 'folds text from inline description and line following comment line' do
|
3485
3510
|
input = <<-EOS
|
3486
3511
|
== Lists
|
3487
3512
|
|
@@ -3496,7 +3521,7 @@ continued
|
|
3496
3521
|
assert_xpath %(//*[@class="dlist"]//dd/p[text()="def1\ncontinued"]), output, 1
|
3497
3522
|
end
|
3498
3523
|
|
3499
|
-
test 'folds text from inline
|
3524
|
+
test 'folds text from inline description and subsequent indented line' do
|
3500
3525
|
input = <<-EOS
|
3501
3526
|
== Lists
|
3502
3527
|
|
@@ -3510,7 +3535,7 @@ term1:: def1
|
|
3510
3535
|
assert_xpath %(//*[@class="dlist"]//dd/p[text()="def1\ncontinued"]), output, 1
|
3511
3536
|
end
|
3512
3537
|
|
3513
|
-
test 'appends literal line offset by blank line as block if item has inline
|
3538
|
+
test 'appends literal line offset by blank line as block if item has inline description' do
|
3514
3539
|
input = <<-EOS
|
3515
3540
|
== Lists
|
3516
3541
|
|
@@ -3527,7 +3552,7 @@ term1:: def1
|
|
3527
3552
|
assert_xpath '//*[@class="dlist"]//dd/p/following-sibling::*[@class="literalblock"]//pre[text()="literal"]', output, 1
|
3528
3553
|
end
|
3529
3554
|
|
3530
|
-
test 'appends literal line offset by blank line as block and appends line after continuation as block if item has inline
|
3555
|
+
test 'appends literal line offset by blank line as block and appends line after continuation as block if item has inline description' do
|
3531
3556
|
input = <<-EOS
|
3532
3557
|
== Lists
|
3533
3558
|
|
@@ -3548,7 +3573,7 @@ para
|
|
3548
3573
|
assert_xpath '//*[@class="dlist"]//dd/*[@class="literalblock"]/following-sibling::*[@class="paragraph"]/p[text()="para"]', output, 1
|
3549
3574
|
end
|
3550
3575
|
|
3551
|
-
test 'appends line after continuation as block and literal line offset by blank line as block if item has inline
|
3576
|
+
test 'appends line after continuation as block and literal line offset by blank line as block if item has inline description' do
|
3552
3577
|
input = <<-EOS
|
3553
3578
|
== Lists
|
3554
3579
|
|
@@ -3569,7 +3594,7 @@ para
|
|
3569
3594
|
assert_xpath '//*[@class="dlist"]//dd/*[@class="paragraph"]/following-sibling::*[@class="literalblock"]//pre[text()="literal"]', output, 1
|
3570
3595
|
end
|
3571
3596
|
|
3572
|
-
test 'appends list if item has inline
|
3597
|
+
test 'appends list if item has inline description' do
|
3573
3598
|
input = <<-EOS
|
3574
3599
|
== Lists
|
3575
3600
|
|
@@ -3587,7 +3612,7 @@ term1:: def1
|
|
3587
3612
|
assert_xpath '//*[@class="dlist"]//dd/p/following-sibling::*[@class="ulist"]/ul/li', output, 3
|
3588
3613
|
end
|
3589
3614
|
|
3590
|
-
test 'appends literal line attached by continuation as block if item has inline
|
3615
|
+
test 'appends literal line attached by continuation as block if item has inline description followed by ruler' do
|
3591
3616
|
input = <<-EOS
|
3592
3617
|
== Lists
|
3593
3618
|
|
@@ -3607,7 +3632,7 @@ term1:: def1
|
|
3607
3632
|
assert_xpath '//*[@class="dlist"]/following-sibling::hr', output, 1
|
3608
3633
|
end
|
3609
3634
|
|
3610
|
-
test 'line offset by blank line breaks list if term has inline
|
3635
|
+
test 'line offset by blank line breaks list if term has inline description' do
|
3611
3636
|
input = <<-EOS
|
3612
3637
|
== Lists
|
3613
3638
|
|
@@ -3624,7 +3649,7 @@ detached
|
|
3624
3649
|
assert_xpath '//*[@class="dlist"]/following-sibling::*[@class="paragraph"]/p[text()="detached"]', output, 1
|
3625
3650
|
end
|
3626
3651
|
|
3627
|
-
test 'nested term with
|
3652
|
+
test 'nested term with description does not consume following heading' do
|
3628
3653
|
input = <<-EOS
|
3629
3654
|
== Lists
|
3630
3655
|
|
@@ -3649,7 +3674,7 @@ Detached
|
|
3649
3674
|
assert_xpath '//*[@class="dlist"]/following-sibling::*[@class="sect2"]/h3[text()="Detached"]', output, 1
|
3650
3675
|
end
|
3651
3676
|
|
3652
|
-
test 'line attached by continuation is appended as paragraph if term has inline
|
3677
|
+
test 'line attached by continuation is appended as paragraph if term has inline description followed by detached paragraph' do
|
3653
3678
|
input = <<-EOS
|
3654
3679
|
== Lists
|
3655
3680
|
|
@@ -3670,7 +3695,7 @@ detached
|
|
3670
3695
|
assert_xpath '//*[@class="dlist"]/following-sibling::*[@class="paragraph"]/p[text()="detached"]', output, 1
|
3671
3696
|
end
|
3672
3697
|
|
3673
|
-
test 'line attached by continuation is appended as paragraph if term has inline
|
3698
|
+
test 'line attached by continuation is appended as paragraph if term has inline description followed by detached block' do
|
3674
3699
|
input = <<-EOS
|
3675
3700
|
== Lists
|
3676
3701
|
|
@@ -3693,7 +3718,7 @@ detached
|
|
3693
3718
|
assert_xpath '//*[@class="dlist"]/following-sibling::*[@class="sidebarblock"]//p[text()="detached"]', output, 1
|
3694
3719
|
end
|
3695
3720
|
|
3696
|
-
test 'line attached by continuation offset by line comment is appended as paragraph if term has inline
|
3721
|
+
test 'line attached by continuation offset by line comment is appended as paragraph if term has inline description' do
|
3697
3722
|
input = <<-EOS
|
3698
3723
|
== Lists
|
3699
3724
|
|
@@ -3711,7 +3736,7 @@ para
|
|
3711
3736
|
assert_xpath '//*[@class="dlist"]//dd/p/following-sibling::*[@class="paragraph"]/p[text()="para"]', output, 1
|
3712
3737
|
end
|
3713
3738
|
|
3714
|
-
test 'line attached by continuation offset by blank line is appended as paragraph if term has inline
|
3739
|
+
test 'line attached by continuation offset by blank line is appended as paragraph if term has inline description' do
|
3715
3740
|
input = <<-EOS
|
3716
3741
|
== Lists
|
3717
3742
|
|