asciidoctor-rfc 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +5 -0
- data/.oss-guides.rubocop.yml +1077 -0
- data/.rspec +1 -0
- data/.rubocop.yml +19 -1063
- data/.travis.yml +3 -2
- data/Guardfile +22 -0
- data/README.adoc +1151 -0
- data/Rakefile +1 -1
- data/asciidoctor-rfc.gemspec +20 -3
- data/bin/asciidoctor-rfc2 +15 -0
- data/bin/asciidoctor-rfc3 +15 -0
- data/bin/rspec +0 -1
- data/lib/asciidoctor-rfc.rb +4 -0
- data/lib/asciidoctor/rfc/common/base.rb +218 -0
- data/lib/asciidoctor/rfc/common/front.rb +120 -0
- data/lib/asciidoctor/rfc/v2/base.rb +341 -0
- data/lib/asciidoctor/rfc/v2/blocks.rb +192 -0
- data/lib/asciidoctor/rfc/v2/converter.rb +64 -0
- data/lib/asciidoctor/rfc/v2/front.rb +69 -0
- data/lib/asciidoctor/rfc/v2/inline_anchor.rb +102 -0
- data/lib/asciidoctor/rfc/v2/lists.rb +134 -0
- data/lib/asciidoctor/rfc/v2/table.rb +112 -0
- data/lib/asciidoctor/rfc/v2/validate.rb +738 -0
- data/lib/asciidoctor/rfc/v2/validate2.rng +716 -0
- data/lib/asciidoctor/rfc/v3/base.rb +358 -0
- data/lib/asciidoctor/rfc/v3/blocks.rb +203 -0
- data/lib/asciidoctor/rfc/v3/converter.rb +64 -0
- data/lib/asciidoctor/rfc/v3/front.rb +115 -0
- data/lib/asciidoctor/rfc/v3/inline_anchor.rb +90 -0
- data/lib/asciidoctor/rfc/v3/lists.rb +190 -0
- data/lib/asciidoctor/rfc/v3/svg.rng +9081 -0
- data/lib/asciidoctor/rfc/v3/table.rb +65 -0
- data/lib/asciidoctor/rfc/v3/validate.rb +2168 -0
- data/lib/asciidoctor/rfc/v3/validate.rng +2143 -0
- data/lib/asciidoctor/rfc/version.rb +2 -2
- data/spec/asciidoctor/rfc/v2/appendix_spec.rb +124 -0
- data/spec/asciidoctor/rfc/v2/area_spec.rb +60 -0
- data/spec/asciidoctor/rfc/v2/author_spec.rb +444 -0
- data/spec/asciidoctor/rfc/v2/comments_spec.rb +316 -0
- data/spec/asciidoctor/rfc/v2/crossref_spec.rb +205 -0
- data/spec/asciidoctor/rfc/v2/date_spec.rb +166 -0
- data/spec/asciidoctor/rfc/v2/dlist_spec.rb +108 -0
- data/spec/asciidoctor/rfc/v2/document_spec.rb +161 -0
- data/spec/asciidoctor/rfc/v2/example_spec.rb +50 -0
- data/spec/asciidoctor/rfc/v2/front_spec.rb +75 -0
- data/spec/asciidoctor/rfc/v2/image_spec.rb +81 -0
- data/spec/asciidoctor/rfc/v2/indexterm_spec.rb +66 -0
- data/spec/asciidoctor/rfc/v2/inline_formatting_spec.rb +177 -0
- data/spec/asciidoctor/rfc/v2/keyword_spec.rb +63 -0
- data/spec/asciidoctor/rfc/v2/listing_spec.rb +59 -0
- data/spec/asciidoctor/rfc/v2/literal_spec.rb +53 -0
- data/spec/asciidoctor/rfc/v2/olist_spec.rb +147 -0
- data/spec/asciidoctor/rfc/v2/paragraph_spec.rb +68 -0
- data/spec/asciidoctor/rfc/v2/preamble_spec.rb +140 -0
- data/spec/asciidoctor/rfc/v2/quote_spec.rb +24 -0
- data/spec/asciidoctor/rfc/v2/references_spec.rb +96 -0
- data/spec/asciidoctor/rfc/v2/section_spec.rb +260 -0
- data/spec/asciidoctor/rfc/v2/sidebar_spec.rb +32 -0
- data/spec/asciidoctor/rfc/v2/table_spec.rb +293 -0
- data/spec/asciidoctor/rfc/v2/ulist_spec.rb +96 -0
- data/spec/asciidoctor/rfc/v2/workgroup_spec.rb +60 -0
- data/spec/asciidoctor/rfc/v3/appendix_spec.rb +130 -0
- data/spec/asciidoctor/rfc/v3/area_spec.rb +63 -0
- data/spec/asciidoctor/rfc/v3/author_spec.rb +540 -0
- data/spec/asciidoctor/rfc/v3/comments_spec.rb +308 -0
- data/spec/asciidoctor/rfc/v3/crossref_spec.rb +269 -0
- data/spec/asciidoctor/rfc/v3/date_spec.rb +149 -0
- data/spec/asciidoctor/rfc/v3/dlist_spec.rb +121 -0
- data/spec/asciidoctor/rfc/v3/document_spec.rb +109 -0
- data/spec/asciidoctor/rfc/v3/example_spec.rb +34 -0
- data/spec/asciidoctor/rfc/v3/front_spec.rb +43 -0
- data/spec/asciidoctor/rfc/v3/image_spec.rb +81 -0
- data/spec/asciidoctor/rfc/v3/indexterm_spec.rb +69 -0
- data/spec/asciidoctor/rfc/v3/inline_formatting_spec.rb +319 -0
- data/spec/asciidoctor/rfc/v3/keyword_spec.rb +33 -0
- data/spec/asciidoctor/rfc/v3/link_spec.rb +34 -0
- data/spec/asciidoctor/rfc/v3/listing_spec.rb +59 -0
- data/spec/asciidoctor/rfc/v3/literal_spec.rb +51 -0
- data/spec/asciidoctor/rfc/v3/olist_spec.rb +168 -0
- data/spec/asciidoctor/rfc/v3/paragraph_spec.rb +73 -0
- data/spec/asciidoctor/rfc/v3/preamble_spec.rb +112 -0
- data/spec/asciidoctor/rfc/v3/quote_spec.rb +91 -0
- data/spec/asciidoctor/rfc/v3/references_spec.rb +147 -0
- data/spec/asciidoctor/rfc/v3/section_spec.rb +198 -0
- data/spec/asciidoctor/rfc/v3/series_info_spec.rb +151 -0
- data/spec/asciidoctor/rfc/v3/sidebar_spec.rb +30 -0
- data/spec/asciidoctor/rfc/v3/table_spec.rb +275 -0
- data/spec/asciidoctor/rfc/v3/ulist_spec.rb +74 -0
- data/spec/asciidoctor/rfc/v3/workgroup_spec.rb +33 -0
- data/spec/examples/davies-template-bare-06.adoc +361 -0
- data/spec/examples/davies-template-bare-06.xml.orig +426 -0
- data/spec/examples/example-v2.adoc +181 -0
- data/spec/examples/example-v2.xml +675 -0
- data/spec/examples/example-v3.adoc +185 -0
- data/spec/examples/example-v3.xml +1009 -0
- data/spec/examples/mib-doc-template-xml-06.adoc +596 -0
- data/spec/examples/mib-doc-template-xml-06.xml.orig +654 -0
- data/spec/examples/rfc1149.md +76 -0
- data/spec/examples/rfc1149.md.2.xml +94 -0
- data/spec/examples/rfc1149.md.3.xml +93 -0
- data/spec/examples/rfc1149.md.adoc +65 -0
- data/spec/examples/rfc2100.md +149 -0
- data/spec/examples/rfc2100.md.2.xml +169 -0
- data/spec/examples/rfc2100.md.3.xml +163 -0
- data/spec/examples/rfc2100.md.adoc +136 -0
- data/spec/examples/rfc3514.md +203 -0
- data/spec/examples/rfc3514.md.2.xml +238 -0
- data/spec/examples/rfc3514.md.3.xml +258 -0
- data/spec/examples/rfc3514.md.adoc +324 -0
- data/spec/examples/rfc5841.md +342 -0
- data/spec/examples/rfc5841.md.2.xml +393 -0
- data/spec/examples/rfc5841.md.3.xml +449 -0
- data/spec/examples/rfc5841.md.adoc +414 -0
- data/spec/examples/rfc6350.adoc +3499 -0
- data/spec/examples/rfc6350.bib +763 -0
- data/spec/examples/rfc748.md +79 -0
- data/spec/examples/rfc748.md.2.xml +116 -0
- data/spec/examples/rfc748.md.3.xml +109 -0
- data/spec/examples/rfc748.md.adoc +80 -0
- data/spec/examples/rfc7511.md +257 -0
- data/spec/examples/rfc7511.md.2.xml +300 -0
- data/spec/examples/rfc7511.md.3.xml +347 -0
- data/spec/examples/rfc7511.md.adoc +417 -0
- data/spec/spec_helper.rb +115 -5
- metadata +274 -9
- data/.hound.yml +0 -3
- data/README.md +0 -84
- data/lib/asciidoctor/rfc.rb +0 -7
- data/spec/asciidoctor-rfc/.keep +0 -0
@@ -0,0 +1,81 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
describe Asciidoctor::RFC::V3::Converter do
|
3
|
+
it "renders an image with block attributes" do
|
4
|
+
expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3)).to be_equivalent_to <<~'OUTPUT'
|
5
|
+
[[id]]
|
6
|
+
.Title
|
7
|
+
[align=center,alt=alt_text]
|
8
|
+
image::http:://www.example/org/filename.jpg[]
|
9
|
+
INPUT
|
10
|
+
<figure>
|
11
|
+
<artwork anchor="id" name="Title" align="center" alt="alt_text" type="binary-art" src="http:://www.example/org/filename.jpg"/>
|
12
|
+
</figure>
|
13
|
+
OUTPUT
|
14
|
+
end
|
15
|
+
it "renders an image with macro attributes" do
|
16
|
+
expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3)).to be_equivalent_to <<~'OUTPUT'
|
17
|
+
[[id]]
|
18
|
+
.Title
|
19
|
+
image::http:://www.example/org/filename.jpg[alt_text,300,200]
|
20
|
+
INPUT
|
21
|
+
<figure>
|
22
|
+
<artwork anchor="id" name="Title" alt="alt_text" type="binary-art" src="http:://www.example/org/filename.jpg" width="300" height="200"/>
|
23
|
+
</figure>
|
24
|
+
OUTPUT
|
25
|
+
end
|
26
|
+
it "skips inline images" do
|
27
|
+
expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3)).to be_equivalent_to <<~'OUTPUT'
|
28
|
+
You should click image:play.jpg[Sunset] to continue.
|
29
|
+
INPUT
|
30
|
+
<t>You should click to continue.</t>
|
31
|
+
OUTPUT
|
32
|
+
end
|
33
|
+
it "skips keyboard shortcuts" do
|
34
|
+
expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3)).to be_equivalent_to <<~'OUTPUT'
|
35
|
+
:experimental:
|
36
|
+
You should click kbd:[F11] to continue.
|
37
|
+
INPUT
|
38
|
+
<t>You should click to continue.</t>
|
39
|
+
OUTPUT
|
40
|
+
end
|
41
|
+
it "skips menu selections" do
|
42
|
+
expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3)).to be_equivalent_to <<~'OUTPUT'
|
43
|
+
:experimental:
|
44
|
+
You should click menu:View[Zoom > Reset] to continue.
|
45
|
+
INPUT
|
46
|
+
<t>You should click to continue.</t>
|
47
|
+
OUTPUT
|
48
|
+
end
|
49
|
+
it "skips UI buttons" do
|
50
|
+
expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3)).to be_equivalent_to <<~'OUTPUT'
|
51
|
+
:experimental:
|
52
|
+
You should click btn:[OK] to continue.
|
53
|
+
INPUT
|
54
|
+
<t>You should click to continue.</t>
|
55
|
+
OUTPUT
|
56
|
+
end
|
57
|
+
it "skips audio" do
|
58
|
+
expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3)).to be_equivalent_to <<~'OUTPUT'
|
59
|
+
Text
|
60
|
+
|
61
|
+
audio::ocean_waves.mp3[options="autoplay,loop"]
|
62
|
+
|
63
|
+
Text
|
64
|
+
INPUT
|
65
|
+
<t>Text</t>
|
66
|
+
<t>Text</t>
|
67
|
+
OUTPUT
|
68
|
+
end
|
69
|
+
it "skips video" do
|
70
|
+
expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3)).to be_equivalent_to <<~'OUTPUT'
|
71
|
+
Text
|
72
|
+
|
73
|
+
video::video_file.mp4[width=640, start=60, end=140, options=autoplay]
|
74
|
+
|
75
|
+
Text
|
76
|
+
INPUT
|
77
|
+
<t>Text</t>
|
78
|
+
<t>Text</t>
|
79
|
+
OUTPUT
|
80
|
+
end
|
81
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
describe Asciidoctor::RFC::V3::Converter do
|
3
|
+
it "renders index" do
|
4
|
+
expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
|
5
|
+
= Document title
|
6
|
+
:abbrev: abbrev_value
|
7
|
+
:docName:
|
8
|
+
Author
|
9
|
+
|
10
|
+
== Section 1
|
11
|
+
This ((indexterm))
|
12
|
+
is visible in the text,
|
13
|
+
this one is not (((indexterm, index-subterm))).
|
14
|
+
INPUT
|
15
|
+
<?xml version="1.0" encoding="US-ASCII"?>
|
16
|
+
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
|
17
|
+
|
18
|
+
<rfc prepTime="2000-01-01T05:00:00Z"
|
19
|
+
version="3" submissionType="IETF">
|
20
|
+
<front>
|
21
|
+
<title abbrev="abbrev_value">Document title</title>
|
22
|
+
<author fullname="Author">
|
23
|
+
</author>
|
24
|
+
<date day="1" month="January" year="2000"/>
|
25
|
+
</front><middle>
|
26
|
+
<section anchor="_section_1" numbered="false">
|
27
|
+
<name>Section 1</name>
|
28
|
+
<t>This indexterm<iref item="indexterm"/>
|
29
|
+
is visible in the text,
|
30
|
+
this one is not <iref item="indexterm" subitem="index-subterm"/>.</t>
|
31
|
+
</section>
|
32
|
+
</middle>
|
33
|
+
</rfc>
|
34
|
+
OUTPUT
|
35
|
+
end
|
36
|
+
it "does not render tertiary index terms" do
|
37
|
+
expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
|
38
|
+
= Document title
|
39
|
+
:abbrev: abbrev_value
|
40
|
+
:docName:
|
41
|
+
Author
|
42
|
+
|
43
|
+
== Section 1
|
44
|
+
This ((indexterm))
|
45
|
+
is visible in the text,
|
46
|
+
this one with a tertiary term is not (((indexterm, index-subterm, index-subsubterm))).
|
47
|
+
INPUT
|
48
|
+
<?xml version="1.0" encoding="US-ASCII"?>
|
49
|
+
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
|
50
|
+
|
51
|
+
<rfc prepTime="2000-01-01T05:00:00Z"
|
52
|
+
version="3" submissionType="IETF">
|
53
|
+
<front>
|
54
|
+
<title abbrev="abbrev_value">Document title</title>
|
55
|
+
<author fullname="Author">
|
56
|
+
</author>
|
57
|
+
<date day="1" month="January" year="2000"/>
|
58
|
+
</front><middle>
|
59
|
+
<section anchor="_section_1" numbered="false">
|
60
|
+
<name>Section 1</name>
|
61
|
+
<t>This indexterm<iref item="indexterm"/>
|
62
|
+
is visible in the text,
|
63
|
+
this one with a tertiary term is not <iref item="indexterm" subitem="index-subterm"/>.</t>
|
64
|
+
</section>
|
65
|
+
</middle>
|
66
|
+
</rfc>
|
67
|
+
OUTPUT
|
68
|
+
end
|
69
|
+
end
|
@@ -0,0 +1,319 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
describe Asciidoctor::RFC::V3::Converter do
|
3
|
+
it "treats bcp14 macro in v3 as <bcp14>" do
|
4
|
+
expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
|
5
|
+
= Document title
|
6
|
+
:abbrev: abbrev_value
|
7
|
+
:docName:
|
8
|
+
Author
|
9
|
+
|
10
|
+
== Section 1
|
11
|
+
This [bcp14]#must not# stand
|
12
|
+
INPUT
|
13
|
+
<?xml version="1.0" encoding="US-ASCII"?>
|
14
|
+
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
|
15
|
+
|
16
|
+
<rfc prepTime="2000-01-01T05:00:00Z"
|
17
|
+
version="3" submissionType="IETF">
|
18
|
+
<front>
|
19
|
+
<title abbrev="abbrev_value">Document title</title>
|
20
|
+
<author fullname="Author">
|
21
|
+
</author>
|
22
|
+
<date day="1" month="January" year="2000"/>
|
23
|
+
</front><middle>
|
24
|
+
<section anchor="_section_1" numbered="false">
|
25
|
+
<name>Section 1</name>
|
26
|
+
<t>This <bcp14>MUST NOT</bcp14> stand</t>
|
27
|
+
</section>
|
28
|
+
</middle>
|
29
|
+
</rfc>
|
30
|
+
OUTPUT
|
31
|
+
end
|
32
|
+
it "treats boldfaced capital BCP14 in v3 as <bcp14> by default" do
|
33
|
+
expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
|
34
|
+
= Document title
|
35
|
+
:abbrev: abbrev_value
|
36
|
+
:docName:
|
37
|
+
Author
|
38
|
+
|
39
|
+
== Section 1
|
40
|
+
This *MUST NOT* stand
|
41
|
+
INPUT
|
42
|
+
<?xml version="1.0" encoding="US-ASCII"?>
|
43
|
+
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
|
44
|
+
|
45
|
+
<rfc prepTime="2000-01-01T05:00:00Z"
|
46
|
+
version="3" submissionType="IETF">
|
47
|
+
<front>
|
48
|
+
<title abbrev="abbrev_value">Document title</title>
|
49
|
+
<author fullname="Author">
|
50
|
+
</author>
|
51
|
+
<date day="1" month="January" year="2000"/>
|
52
|
+
</front><middle>
|
53
|
+
<section anchor="_section_1" numbered="false">
|
54
|
+
<name>Section 1</name>
|
55
|
+
<t>This <bcp14>MUST NOT</bcp14> stand</t>
|
56
|
+
</section>
|
57
|
+
</middle>
|
58
|
+
</rfc>
|
59
|
+
OUTPUT
|
60
|
+
end
|
61
|
+
it "treats boldfaced capital BCP14 in v3 as normal strong text, if flag :no-rfc-bold-bcp14:." do
|
62
|
+
expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
|
63
|
+
= Document title
|
64
|
+
:abbrev: abbrev_value
|
65
|
+
:no-rfc-bold-bcp14:
|
66
|
+
:docName:
|
67
|
+
Author
|
68
|
+
|
69
|
+
== Section 1
|
70
|
+
This *MUST NOT* stand
|
71
|
+
INPUT
|
72
|
+
<?xml version="1.0" encoding="US-ASCII"?>
|
73
|
+
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
|
74
|
+
|
75
|
+
<rfc prepTime="2000-01-01T05:00:00Z"
|
76
|
+
version="3" submissionType="IETF">
|
77
|
+
<front>
|
78
|
+
<title abbrev="abbrev_value">Document title</title>
|
79
|
+
<author fullname="Author">
|
80
|
+
</author>
|
81
|
+
<date day="1" month="January" year="2000"/>
|
82
|
+
</front><middle>
|
83
|
+
<section anchor="_section_1" numbered="false">
|
84
|
+
<name>Section 1</name>
|
85
|
+
<t>This <strong>MUST NOT</strong> stand</t>
|
86
|
+
</section>
|
87
|
+
</middle>
|
88
|
+
</rfc>
|
89
|
+
OUTPUT
|
90
|
+
end
|
91
|
+
it "respects Asciidoctor inline formatting" do
|
92
|
+
expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
|
93
|
+
= Document title
|
94
|
+
:abbrev: abbrev_value
|
95
|
+
:docName:
|
96
|
+
Author
|
97
|
+
|
98
|
+
== Section 1
|
99
|
+
_Text_ *Text* `Text` "`Text`" '`Text`' ^Superscript^ ~Subscript~
|
100
|
+
INPUT
|
101
|
+
<?xml version="1.0" encoding="US-ASCII"?>
|
102
|
+
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
|
103
|
+
|
104
|
+
<rfc prepTime="2000-01-01T05:00:00Z"
|
105
|
+
version="3" submissionType="IETF">
|
106
|
+
<front>
|
107
|
+
<title abbrev="abbrev_value">Document title</title>
|
108
|
+
<author fullname="Author">
|
109
|
+
</author>
|
110
|
+
<date day="1" month="January" year="2000"/>
|
111
|
+
</front><middle>
|
112
|
+
<section anchor="_section_1" numbered="false">
|
113
|
+
<name>Section 1</name>
|
114
|
+
<t><em>Text</em> <strong>Text</strong> <tt>Text</tt> “Text” ‘Text’ <sup>Superscript</sup> <sub>Subscript</sub></t>
|
115
|
+
</section>
|
116
|
+
</middle>
|
117
|
+
</rfc>
|
118
|
+
OUTPUT
|
119
|
+
end
|
120
|
+
it "allows suppression of smart quotes" do
|
121
|
+
expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
|
122
|
+
= Document title
|
123
|
+
:abbrev: abbrev_value
|
124
|
+
:docName:
|
125
|
+
:smart-quotes: false
|
126
|
+
Author
|
127
|
+
|
128
|
+
== Section 1
|
129
|
+
"`Text`" '`Text`'
|
130
|
+
INPUT
|
131
|
+
<?xml version="1.0" encoding="US-ASCII"?>
|
132
|
+
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
|
133
|
+
|
134
|
+
<rfc
|
135
|
+
submissionType="IETF">
|
136
|
+
<front>
|
137
|
+
<title abbrev="abbrev_value">Document title</title>
|
138
|
+
<author fullname="Author"/>
|
139
|
+
<date day="1" month="January" year="2000"/>
|
140
|
+
</front><middle>
|
141
|
+
<section anchor="_section_1" title="Section 1">
|
142
|
+
<t>"Text" 'Text'</t>
|
143
|
+
</section>
|
144
|
+
</middle>
|
145
|
+
</rfc>
|
146
|
+
OUTPUT
|
147
|
+
end
|
148
|
+
it "renders stem as literal" do
|
149
|
+
expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
|
150
|
+
= Document title
|
151
|
+
:abbrev: abbrev_value
|
152
|
+
:docName:
|
153
|
+
Author
|
154
|
+
:stem:
|
155
|
+
|
156
|
+
== Section 1
|
157
|
+
stem:[sqrt(4) = 2]
|
158
|
+
INPUT
|
159
|
+
<?xml version="1.0" encoding="US-ASCII"?>
|
160
|
+
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
|
161
|
+
|
162
|
+
<rfc prepTime="2000-01-01T05:00:00Z"
|
163
|
+
version="3" submissionType="IETF">
|
164
|
+
<front>
|
165
|
+
<title abbrev="abbrev_value">Document title</title>
|
166
|
+
<author fullname="Author">
|
167
|
+
</author>
|
168
|
+
<date day="1" month="January" year="2000"/>
|
169
|
+
</front><middle>
|
170
|
+
<section anchor="_section_1" numbered="false">
|
171
|
+
<name>Section 1</name>
|
172
|
+
<t>sqrt(4) = 2</t>
|
173
|
+
</section>
|
174
|
+
</middle>
|
175
|
+
</rfc>
|
176
|
+
OUTPUT
|
177
|
+
end
|
178
|
+
it "render line break within table" do
|
179
|
+
expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
|
180
|
+
= Document title
|
181
|
+
Author
|
182
|
+
|
183
|
+
== Section 1
|
184
|
+
.Table Title
|
185
|
+
[cols="2"]
|
186
|
+
|===
|
187
|
+
|head
|
188
|
+
|head +
|
189
|
+
head
|
190
|
+
|
191
|
+
h|header cell | *body* cell +
|
192
|
+
cell
|
193
|
+
|===
|
194
|
+
INPUT
|
195
|
+
<?xml version="1.0" encoding="US-ASCII"?>
|
196
|
+
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
|
197
|
+
|
198
|
+
<rfc submissionType="IETF" prepTime="2000-01-01T05:00:00Z" version="3">
|
199
|
+
<front>
|
200
|
+
<title>Document title</title>
|
201
|
+
<author fullname="Author"/>
|
202
|
+
<date day="1" month="January" year="2000"/>
|
203
|
+
</front><middle>
|
204
|
+
<section anchor="_section_1" numbered="false">
|
205
|
+
<name>Section 1</name>
|
206
|
+
<table>
|
207
|
+
<name>Table Title</name>
|
208
|
+
<tbody>
|
209
|
+
<tr>
|
210
|
+
<td align="left">head</td>
|
211
|
+
<td align="left">head<br/>
|
212
|
+
head</td>
|
213
|
+
</tr>
|
214
|
+
<tr>
|
215
|
+
<th align="left">header cell</th>
|
216
|
+
<td align="left"><strong>body</strong> cell<br/>
|
217
|
+
cell</td>
|
218
|
+
</tr>
|
219
|
+
</tbody>
|
220
|
+
</table>
|
221
|
+
</section>
|
222
|
+
</middle>
|
223
|
+
</rfc>
|
224
|
+
OUTPUT
|
225
|
+
end
|
226
|
+
it "ignore line break outside of table" do
|
227
|
+
expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
|
228
|
+
= Document title
|
229
|
+
:abbrev: abbrev_value
|
230
|
+
:docName:
|
231
|
+
Author
|
232
|
+
:stem:
|
233
|
+
|
234
|
+
== Section 1
|
235
|
+
Hello +
|
236
|
+
This is a line break
|
237
|
+
INPUT
|
238
|
+
<?xml version="1.0" encoding="US-ASCII"?>
|
239
|
+
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
|
240
|
+
|
241
|
+
<rfc submissionType="IETF" prepTime="2000-01-01T05:00:00Z" version="3">
|
242
|
+
<front>
|
243
|
+
<title abbrev="abbrev_value">Document title</title>
|
244
|
+
<author fullname="Author"/>
|
245
|
+
<date day="1" month="January" year="2000"/>
|
246
|
+
</front><middle>
|
247
|
+
<section anchor="_section_1" numbered="false">
|
248
|
+
<name>Section 1</name>
|
249
|
+
<t>Hello
|
250
|
+
This is a line break</t>
|
251
|
+
</section>
|
252
|
+
</middle>
|
253
|
+
</rfc>
|
254
|
+
OUTPUT
|
255
|
+
end
|
256
|
+
it "deals with non-Ascii characters" do
|
257
|
+
expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
|
258
|
+
= Document title
|
259
|
+
:abbrev: abbrev_value
|
260
|
+
:docName:
|
261
|
+
Author
|
262
|
+
|
263
|
+
== Section 1
|
264
|
+
Hello René! Hello Владимир!
|
265
|
+
|
266
|
+
INPUT
|
267
|
+
<?xml version="1.0" encoding="US-ASCII"?>
|
268
|
+
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
|
269
|
+
|
270
|
+
<rfc submissionType="IETF" prepTime="2000-01-01T05:00:00Z" version="3">
|
271
|
+
<front>
|
272
|
+
<title abbrev="abbrev_value">Document title</title>
|
273
|
+
<author fullname="Author"/>
|
274
|
+
<date day="1" month="January" year="2000"/>
|
275
|
+
</front><middle>
|
276
|
+
<section anchor="_section_1" numbered="false">
|
277
|
+
<name>Section 1</name>
|
278
|
+
<t>Hello René! Hello Владимир!</t>
|
279
|
+
</section>
|
280
|
+
</middle>
|
281
|
+
</rfc>
|
282
|
+
OUTPUT
|
283
|
+
end
|
284
|
+
it "deals with HTML entities" do
|
285
|
+
expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
|
286
|
+
= Document title
|
287
|
+
:abbrev: abbrev_value
|
288
|
+
:docName:
|
289
|
+
Author
|
290
|
+
:stem:
|
291
|
+
|
292
|
+
== Section 1
|
293
|
+
Hello < (&lt;)
|
294
|
+
|
295
|
+
== Section 2
|
296
|
+
Hello < (&lt;)
|
297
|
+
INPUT
|
298
|
+
<?xml version="1.0" encoding="US-ASCII"?>
|
299
|
+
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
|
300
|
+
|
301
|
+
<rfc submissionType="IETF" prepTime="2000-01-01T05:00:00Z" version="3">
|
302
|
+
<front>
|
303
|
+
<title abbrev="abbrev_value">Document title</title>
|
304
|
+
<author fullname="Author"/>
|
305
|
+
<date day="1" month="January" year="2000"/>
|
306
|
+
</front><middle>
|
307
|
+
<section anchor="_section_1" numbered="false">
|
308
|
+
<name>Section 1</name>
|
309
|
+
<t>Hello < (&lt;)</t>
|
310
|
+
</section>
|
311
|
+
<section anchor="_section_2" numbered="false">
|
312
|
+
<name>Section 2</name>
|
313
|
+
<t>Hello < (&lt;)</t>
|
314
|
+
</section>
|
315
|
+
</middle>
|
316
|
+
</rfc>
|
317
|
+
OUTPUT
|
318
|
+
end
|
319
|
+
end
|