asciidoctor 0.0.5 → 0.0.6
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.
- data/README.asciidoc +156 -0
- data/asciidoctor.gemspec +5 -4
- data/lib/asciidoctor.rb +46 -34
- data/lib/asciidoctor/block.rb +59 -42
- data/lib/asciidoctor/document.rb +56 -20
- data/lib/asciidoctor/lexer.rb +204 -107
- data/lib/asciidoctor/list_item.rb +47 -14
- data/lib/asciidoctor/reader.rb +29 -14
- data/lib/asciidoctor/render_templates.rb +162 -64
- data/lib/asciidoctor/renderer.rb +3 -3
- data/lib/asciidoctor/section.rb +32 -6
- data/lib/asciidoctor/version.rb +1 -1
- data/test/attributes_test.rb +44 -4
- data/test/document_test.rb +21 -2
- data/test/headers_test.rb +72 -13
- data/test/lexer_test.rb +54 -0
- data/test/lists_test.rb +406 -0
- data/test/paragraphs_test.rb +103 -3
- data/test/preamble_test.rb +88 -0
- data/test/test_helper.rb +6 -5
- data/test/text_test.rb +2 -1
- metadata +7 -5
- data/README.md +0 -154
- data/test/list_elements_test.rb +0 -55
data/test/list_elements_test.rb
DELETED
@@ -1,55 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
context "Bulleted lists (:ulist)" do
|
4
|
-
context "Simple lists" do
|
5
|
-
test "dash elements with no blank lines" do
|
6
|
-
output = render_string("Blah\n====\n- Foo\n- Boo\n- Blech")
|
7
|
-
assert_xpath '//ul', output, 1
|
8
|
-
assert_xpath '//ul/li', output, 3
|
9
|
-
end
|
10
|
-
|
11
|
-
test "dash elements with blank lines" do
|
12
|
-
assert_xpath '//ul/li', render_string("Blah\n====\n- Foo\n\n- Boo\n\n- Blech"), 3
|
13
|
-
end
|
14
|
-
|
15
|
-
test "asterisk elements with no blank lines" do
|
16
|
-
assert_xpath '//ul/li', render_string("Blah\n====\n* Foo\n* Boo\n* Blech"), 3
|
17
|
-
end
|
18
|
-
|
19
|
-
test "asterisk elements with blank lines" do
|
20
|
-
assert_xpath '//ul/li', render_string("Blah\n====\n* Foo\n\n* Boo\n\n* Blech"), 3
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
context "Nested lists" do
|
25
|
-
test "nested mixed elements (asterisk and dash)" do
|
26
|
-
output = render_string("Blah\n====\n- Foo\n* Boo\n- Blech")
|
27
|
-
assert_xpath '//ul', output, 1
|
28
|
-
assert_xpath '//ul/li', output, 3
|
29
|
-
end
|
30
|
-
|
31
|
-
test "nested elements (2) with asterisks" do
|
32
|
-
output = render_string("* Foo\n** Boo\n* Blech")
|
33
|
-
assert_xpath '//ul', output, 2
|
34
|
-
assert_xpath '//ul/li', output, 3
|
35
|
-
end
|
36
|
-
|
37
|
-
test "nested elements (3) with asterisks" do
|
38
|
-
output = render_string("Blah\n====\n* Foo\n** Boo\n*** Snoo\n* Blech")
|
39
|
-
assert_xpath '//ul', output, 3
|
40
|
-
assert_xpath '//ul/li', output, 4
|
41
|
-
end
|
42
|
-
|
43
|
-
test "nested elements (4) with asterisks" do
|
44
|
-
output = render_string("Blah\n====\n* Foo\n** Boo\n*** Snoo\n**** Froo\n* Blech")
|
45
|
-
assert_xpath '//ul', output, 4
|
46
|
-
assert_xpath '//ul/li', output, 5
|
47
|
-
end
|
48
|
-
|
49
|
-
test "nested elements (5) with asterisks" do
|
50
|
-
output = render_string("Blah\n====\n* Foo\n** Boo\n*** Snoo\n**** Froo\n***** Groo\n* Blech")
|
51
|
-
assert_xpath '//ul', output, 5
|
52
|
-
assert_xpath '//ul/li', output, 6
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|