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.
Files changed (130) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +5 -0
  3. data/.oss-guides.rubocop.yml +1077 -0
  4. data/.rspec +1 -0
  5. data/.rubocop.yml +19 -1063
  6. data/.travis.yml +3 -2
  7. data/Guardfile +22 -0
  8. data/README.adoc +1151 -0
  9. data/Rakefile +1 -1
  10. data/asciidoctor-rfc.gemspec +20 -3
  11. data/bin/asciidoctor-rfc2 +15 -0
  12. data/bin/asciidoctor-rfc3 +15 -0
  13. data/bin/rspec +0 -1
  14. data/lib/asciidoctor-rfc.rb +4 -0
  15. data/lib/asciidoctor/rfc/common/base.rb +218 -0
  16. data/lib/asciidoctor/rfc/common/front.rb +120 -0
  17. data/lib/asciidoctor/rfc/v2/base.rb +341 -0
  18. data/lib/asciidoctor/rfc/v2/blocks.rb +192 -0
  19. data/lib/asciidoctor/rfc/v2/converter.rb +64 -0
  20. data/lib/asciidoctor/rfc/v2/front.rb +69 -0
  21. data/lib/asciidoctor/rfc/v2/inline_anchor.rb +102 -0
  22. data/lib/asciidoctor/rfc/v2/lists.rb +134 -0
  23. data/lib/asciidoctor/rfc/v2/table.rb +112 -0
  24. data/lib/asciidoctor/rfc/v2/validate.rb +738 -0
  25. data/lib/asciidoctor/rfc/v2/validate2.rng +716 -0
  26. data/lib/asciidoctor/rfc/v3/base.rb +358 -0
  27. data/lib/asciidoctor/rfc/v3/blocks.rb +203 -0
  28. data/lib/asciidoctor/rfc/v3/converter.rb +64 -0
  29. data/lib/asciidoctor/rfc/v3/front.rb +115 -0
  30. data/lib/asciidoctor/rfc/v3/inline_anchor.rb +90 -0
  31. data/lib/asciidoctor/rfc/v3/lists.rb +190 -0
  32. data/lib/asciidoctor/rfc/v3/svg.rng +9081 -0
  33. data/lib/asciidoctor/rfc/v3/table.rb +65 -0
  34. data/lib/asciidoctor/rfc/v3/validate.rb +2168 -0
  35. data/lib/asciidoctor/rfc/v3/validate.rng +2143 -0
  36. data/lib/asciidoctor/rfc/version.rb +2 -2
  37. data/spec/asciidoctor/rfc/v2/appendix_spec.rb +124 -0
  38. data/spec/asciidoctor/rfc/v2/area_spec.rb +60 -0
  39. data/spec/asciidoctor/rfc/v2/author_spec.rb +444 -0
  40. data/spec/asciidoctor/rfc/v2/comments_spec.rb +316 -0
  41. data/spec/asciidoctor/rfc/v2/crossref_spec.rb +205 -0
  42. data/spec/asciidoctor/rfc/v2/date_spec.rb +166 -0
  43. data/spec/asciidoctor/rfc/v2/dlist_spec.rb +108 -0
  44. data/spec/asciidoctor/rfc/v2/document_spec.rb +161 -0
  45. data/spec/asciidoctor/rfc/v2/example_spec.rb +50 -0
  46. data/spec/asciidoctor/rfc/v2/front_spec.rb +75 -0
  47. data/spec/asciidoctor/rfc/v2/image_spec.rb +81 -0
  48. data/spec/asciidoctor/rfc/v2/indexterm_spec.rb +66 -0
  49. data/spec/asciidoctor/rfc/v2/inline_formatting_spec.rb +177 -0
  50. data/spec/asciidoctor/rfc/v2/keyword_spec.rb +63 -0
  51. data/spec/asciidoctor/rfc/v2/listing_spec.rb +59 -0
  52. data/spec/asciidoctor/rfc/v2/literal_spec.rb +53 -0
  53. data/spec/asciidoctor/rfc/v2/olist_spec.rb +147 -0
  54. data/spec/asciidoctor/rfc/v2/paragraph_spec.rb +68 -0
  55. data/spec/asciidoctor/rfc/v2/preamble_spec.rb +140 -0
  56. data/spec/asciidoctor/rfc/v2/quote_spec.rb +24 -0
  57. data/spec/asciidoctor/rfc/v2/references_spec.rb +96 -0
  58. data/spec/asciidoctor/rfc/v2/section_spec.rb +260 -0
  59. data/spec/asciidoctor/rfc/v2/sidebar_spec.rb +32 -0
  60. data/spec/asciidoctor/rfc/v2/table_spec.rb +293 -0
  61. data/spec/asciidoctor/rfc/v2/ulist_spec.rb +96 -0
  62. data/spec/asciidoctor/rfc/v2/workgroup_spec.rb +60 -0
  63. data/spec/asciidoctor/rfc/v3/appendix_spec.rb +130 -0
  64. data/spec/asciidoctor/rfc/v3/area_spec.rb +63 -0
  65. data/spec/asciidoctor/rfc/v3/author_spec.rb +540 -0
  66. data/spec/asciidoctor/rfc/v3/comments_spec.rb +308 -0
  67. data/spec/asciidoctor/rfc/v3/crossref_spec.rb +269 -0
  68. data/spec/asciidoctor/rfc/v3/date_spec.rb +149 -0
  69. data/spec/asciidoctor/rfc/v3/dlist_spec.rb +121 -0
  70. data/spec/asciidoctor/rfc/v3/document_spec.rb +109 -0
  71. data/spec/asciidoctor/rfc/v3/example_spec.rb +34 -0
  72. data/spec/asciidoctor/rfc/v3/front_spec.rb +43 -0
  73. data/spec/asciidoctor/rfc/v3/image_spec.rb +81 -0
  74. data/spec/asciidoctor/rfc/v3/indexterm_spec.rb +69 -0
  75. data/spec/asciidoctor/rfc/v3/inline_formatting_spec.rb +319 -0
  76. data/spec/asciidoctor/rfc/v3/keyword_spec.rb +33 -0
  77. data/spec/asciidoctor/rfc/v3/link_spec.rb +34 -0
  78. data/spec/asciidoctor/rfc/v3/listing_spec.rb +59 -0
  79. data/spec/asciidoctor/rfc/v3/literal_spec.rb +51 -0
  80. data/spec/asciidoctor/rfc/v3/olist_spec.rb +168 -0
  81. data/spec/asciidoctor/rfc/v3/paragraph_spec.rb +73 -0
  82. data/spec/asciidoctor/rfc/v3/preamble_spec.rb +112 -0
  83. data/spec/asciidoctor/rfc/v3/quote_spec.rb +91 -0
  84. data/spec/asciidoctor/rfc/v3/references_spec.rb +147 -0
  85. data/spec/asciidoctor/rfc/v3/section_spec.rb +198 -0
  86. data/spec/asciidoctor/rfc/v3/series_info_spec.rb +151 -0
  87. data/spec/asciidoctor/rfc/v3/sidebar_spec.rb +30 -0
  88. data/spec/asciidoctor/rfc/v3/table_spec.rb +275 -0
  89. data/spec/asciidoctor/rfc/v3/ulist_spec.rb +74 -0
  90. data/spec/asciidoctor/rfc/v3/workgroup_spec.rb +33 -0
  91. data/spec/examples/davies-template-bare-06.adoc +361 -0
  92. data/spec/examples/davies-template-bare-06.xml.orig +426 -0
  93. data/spec/examples/example-v2.adoc +181 -0
  94. data/spec/examples/example-v2.xml +675 -0
  95. data/spec/examples/example-v3.adoc +185 -0
  96. data/spec/examples/example-v3.xml +1009 -0
  97. data/spec/examples/mib-doc-template-xml-06.adoc +596 -0
  98. data/spec/examples/mib-doc-template-xml-06.xml.orig +654 -0
  99. data/spec/examples/rfc1149.md +76 -0
  100. data/spec/examples/rfc1149.md.2.xml +94 -0
  101. data/spec/examples/rfc1149.md.3.xml +93 -0
  102. data/spec/examples/rfc1149.md.adoc +65 -0
  103. data/spec/examples/rfc2100.md +149 -0
  104. data/spec/examples/rfc2100.md.2.xml +169 -0
  105. data/spec/examples/rfc2100.md.3.xml +163 -0
  106. data/spec/examples/rfc2100.md.adoc +136 -0
  107. data/spec/examples/rfc3514.md +203 -0
  108. data/spec/examples/rfc3514.md.2.xml +238 -0
  109. data/spec/examples/rfc3514.md.3.xml +258 -0
  110. data/spec/examples/rfc3514.md.adoc +324 -0
  111. data/spec/examples/rfc5841.md +342 -0
  112. data/spec/examples/rfc5841.md.2.xml +393 -0
  113. data/spec/examples/rfc5841.md.3.xml +449 -0
  114. data/spec/examples/rfc5841.md.adoc +414 -0
  115. data/spec/examples/rfc6350.adoc +3499 -0
  116. data/spec/examples/rfc6350.bib +763 -0
  117. data/spec/examples/rfc748.md +79 -0
  118. data/spec/examples/rfc748.md.2.xml +116 -0
  119. data/spec/examples/rfc748.md.3.xml +109 -0
  120. data/spec/examples/rfc748.md.adoc +80 -0
  121. data/spec/examples/rfc7511.md +257 -0
  122. data/spec/examples/rfc7511.md.2.xml +300 -0
  123. data/spec/examples/rfc7511.md.3.xml +347 -0
  124. data/spec/examples/rfc7511.md.adoc +417 -0
  125. data/spec/spec_helper.rb +115 -5
  126. metadata +274 -9
  127. data/.hound.yml +0 -3
  128. data/README.md +0 -84
  129. data/lib/asciidoctor/rfc.rb +0 -7
  130. data/spec/asciidoctor-rfc/.keep +0 -0
@@ -0,0 +1,96 @@
1
+ require "spec_helper"
2
+ describe Asciidoctor::RFC::V2::Converter do
3
+ it "renders an unordered list" do
4
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2)).to be_equivalent_to <<~'OUTPUT'
5
+ [[id]]
6
+ * First
7
+ * Second
8
+ INPUT
9
+ <t>
10
+ <list style="symbols">
11
+ <t>First</t>
12
+ <t>Second</t>
13
+ </list>
14
+ </t>
15
+ OUTPUT
16
+ end
17
+
18
+ it "ignores anchors on unordered list items" do
19
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2)).to be_equivalent_to <<~'OUTPUT'
20
+ [[id]]
21
+ * First
22
+ * [[id1]] Second
23
+ INPUT
24
+ <t>
25
+ <list style="symbols">
26
+ <t>First</t>
27
+ <t> Second</t>
28
+ </list>
29
+ </t>
30
+ OUTPUT
31
+ end
32
+
33
+ it "renders an unordered list with empty style" do
34
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2)).to be_equivalent_to <<~'OUTPUT'
35
+ [empty]
36
+ * First
37
+ * Second
38
+ INPUT
39
+ <t>
40
+ <list style="empty">
41
+ <t>First</t>
42
+ <t>Second</t>
43
+ </list>
44
+ </t>
45
+ OUTPUT
46
+ end
47
+
48
+ it "renders a nested unordered list" do
49
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2)).to be_equivalent_to <<~'OUTPUT'
50
+ [[id]]
51
+ * First
52
+ * Second
53
+ ** Third
54
+ ** Fourth
55
+ * Fifth
56
+ * Sixth
57
+ INPUT
58
+ <t>
59
+ <list style="symbols">
60
+ <t>First</t>
61
+ <t>Second
62
+ <list style="symbols">
63
+ <t>Third</t>
64
+ <t>Fourth</t>
65
+ </list>
66
+ </t>
67
+ <t>Fifth</t>
68
+ <t>Sixth</t>
69
+ </list>
70
+ </t>
71
+ OUTPUT
72
+ end
73
+
74
+ it "renders a nested ordered/unordered list" do
75
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2)).to be_equivalent_to <<~'OUTPUT'
76
+ [[id]]
77
+ * First
78
+ * Second
79
+ [lowerroman]
80
+ .. Third
81
+ .. Fourth
82
+ INPUT
83
+ <t>
84
+ <list style="symbols">
85
+ <t>First</t>
86
+ <t>Second
87
+ <list style="format %i.">
88
+ <t>Third</t>
89
+ <t>Fourth</t>
90
+ </list>
91
+ </t>
92
+ </list>
93
+ </t>
94
+ OUTPUT
95
+ end
96
+ end
@@ -0,0 +1,60 @@
1
+ require "spec_helper"
2
+ describe Asciidoctor::RFC::V2::Converter do
3
+ it "renders workgroups" do
4
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
5
+ = Document title
6
+ :docName:
7
+ Author
8
+ :workgroup: first_workgroup, second_workgroup
9
+
10
+ == Section 1
11
+ text
12
+ INPUT
13
+ <?xml version="1.0" encoding="US-ASCII"?>
14
+ <!DOCTYPE rfc SYSTEM "rfc2629.dtd">
15
+
16
+ <rfc
17
+ submissionType="IETF">
18
+ <front>
19
+ <title>Document title</title>
20
+ <author fullname="Author"/>
21
+ <date day="1" month="January" year="2000"/>
22
+ <workgroup>first_workgroup</workgroup><workgroup>second_workgroup</workgroup>
23
+ </front><middle>
24
+ <section anchor="_section_1" title="Section 1">
25
+ <t>text</t>
26
+ </section>
27
+ </middle>
28
+ </rfc>
29
+ OUTPUT
30
+ end
31
+
32
+ it "deals with entities in workgroups" do
33
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
34
+ = Document title
35
+ :docName:
36
+ Author
37
+ :workgroup: first_workgroup & second_workgroup
38
+
39
+ == Section 1
40
+ text
41
+ INPUT
42
+ <?xml version="1.0" encoding="US-ASCII"?>
43
+ <!DOCTYPE rfc SYSTEM "rfc2629.dtd">
44
+
45
+ <rfc
46
+ submissionType="IETF">
47
+ <front>
48
+ <title>Document title</title>
49
+ <author fullname="Author"/>
50
+ <date day="1" month="January" year="2000"/>
51
+ <workgroup>first_workgroup &amp; second_workgroup</workgroup>
52
+ </front><middle>
53
+ <section anchor="_section_1" title="Section 1">
54
+ <t>text</t>
55
+ </section>
56
+ </middle>
57
+ </rfc>
58
+ OUTPUT
59
+ end
60
+ end
@@ -0,0 +1,130 @@
1
+ require "spec_helper"
2
+ describe Asciidoctor::RFC::V3::Converter do
3
+ it "renders appendix when section tagged with appendix" do
4
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
5
+ = Document title
6
+ :docName:
7
+ Author
8
+
9
+ == Section 1
10
+ text
11
+
12
+ [appendix]
13
+ == Appendix
14
+ text
15
+ INPUT
16
+ <?xml version="1.0" encoding="US-ASCII"?>
17
+ <!DOCTYPE rfc SYSTEM "rfc2629.dtd">
18
+
19
+ <rfc prepTime="2000-01-01T05:00:00Z"
20
+ version="3" submissionType="IETF">
21
+ <front>
22
+ <title>Document title</title>
23
+ <author fullname="Author">
24
+ </author>
25
+ <date day="1" month="January" year="2000"/>
26
+ </front><middle>
27
+ <section anchor="_section_1" numbered="false">
28
+ <name>Section 1</name>
29
+ <t>text</t>
30
+ </section>
31
+ </middle><back>
32
+ <section anchor="_appendix" numbered="false">
33
+ <name>Appendix</name>
34
+ <t>text</t>
35
+ </section>
36
+ </back>
37
+ </rfc>
38
+ OUTPUT
39
+ end
40
+ it "renders appendix when section follows references" do
41
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
42
+ = Document title
43
+ :docName:
44
+ Author
45
+
46
+ == Section 1
47
+ text
48
+
49
+ [bibliography]
50
+ == Biblio
51
+ ++++
52
+ <reference anchor='ISO.IEC.10118-3' target='https://www.iso.org/standard/67116.html'>
53
+ <front>
54
+ <title>ISO/IEC FDIS 10118-3 -- Information technology -- Security techniques -- Hash-functions -- Part 3: Dedicated hash-functions</title>
55
+ <author>
56
+ <organization>International Organization for Standardization</organization>
57
+ <address>
58
+ <postal>
59
+ <street>BIBC II</street>
60
+ <street>Chemin de Blandonnet 8</street>
61
+ <street>CP 401</street>
62
+ <city>Vernier</city>
63
+ <region>Geneva</region>
64
+ <code>1214</code>
65
+ <country>Switzerland</country>
66
+ </postal>
67
+ <phone>+41 22 749 01 11</phone>
68
+ <email>central@iso.org</email>
69
+ <uri>https://www.iso.org/</uri>
70
+ </address>
71
+ </author>
72
+ <date day='15' month='September' year='2017'/>
73
+ </front>
74
+ </reference>
75
+ ++++
76
+
77
+ == Appendix
78
+ text
79
+ INPUT
80
+ <?xml version="1.0" encoding="US-ASCII"?>
81
+ <!DOCTYPE rfc SYSTEM "rfc2629.dtd">
82
+
83
+ <rfc prepTime="2000-01-01T05:00:00Z"
84
+ version="3" submissionType="IETF">
85
+ <front>
86
+ <title>Document title</title>
87
+ <author fullname="Author">
88
+ </author>
89
+ <date day="1" month="January" year="2000"/>
90
+ </front><middle>
91
+ <section anchor="_section_1" numbered="false">
92
+ <name>Section 1</name>
93
+ <t>text</t>
94
+ </section>
95
+ </middle><back>
96
+ <references anchor="_biblio">
97
+ <name>Biblio</name>
98
+ <reference anchor='ISO.IEC.10118-3' target='https://www.iso.org/standard/67116.html'>
99
+ <front>
100
+ <title>ISO/IEC FDIS 10118-3 -- Information technology -- Security techniques -- Hash-functions -- Part 3: Dedicated hash-functions</title>
101
+ <author>
102
+ <organization>International Organization for Standardization</organization>
103
+ <address>
104
+ <postal>
105
+ <street>BIBC II</street>
106
+ <street>Chemin de Blandonnet 8</street>
107
+ <street>CP 401</street>
108
+ <city>Vernier</city>
109
+ <region>Geneva</region>
110
+ <code>1214</code>
111
+ <country>Switzerland</country>
112
+ </postal>
113
+ <phone>+41 22 749 01 11</phone>
114
+ <email>central@iso.org</email>
115
+ <uri>https://www.iso.org/</uri>
116
+ </address>
117
+ </author>
118
+ <date day='15' month='September' year='2017'/>
119
+ </front>
120
+ </reference>
121
+ </references>
122
+ <section anchor="_appendix" numbered="false">
123
+ <name>Appendix</name>
124
+ <t>text</t>
125
+ </section>
126
+ </back>
127
+ </rfc>
128
+ OUTPUT
129
+ end
130
+ end
@@ -0,0 +1,63 @@
1
+ require "spec_helper"
2
+ describe Asciidoctor::RFC::V3::Converter do
3
+ it "renders areas" do
4
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
5
+ = Document title
6
+ :docName:
7
+ Author
8
+ :area: first_area, second_area
9
+
10
+ == Section 1
11
+ Text
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" version="3" submissionType="IETF">
17
+ <front>
18
+ <title>Document title</title>
19
+ <author fullname="Author">
20
+ </author>
21
+ <date day="1" month="January" year="2000"/>
22
+ <area>first_area</area>
23
+ <area>second_area</area>
24
+ </front><middle>
25
+ <section anchor="_section_1" numbered="false">
26
+ <name>Section 1</name>
27
+ <t>Text</t>
28
+ </section>
29
+ </middle>
30
+ </rfc>
31
+ OUTPUT
32
+ end
33
+
34
+ it "deals with entities in areas" do
35
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
36
+ = Document title
37
+ :docName:
38
+ Author
39
+ :area: first_area & second_area
40
+
41
+ == Section 1
42
+ Text
43
+ INPUT
44
+ <?xml version="1.0" encoding="US-ASCII"?>
45
+ <!DOCTYPE rfc SYSTEM "rfc2629.dtd">
46
+
47
+ <rfc prepTime="2000-01-01T05:00:00Z" version="3" submissionType="IETF">
48
+ <front>
49
+ <title>Document title</title>
50
+ <author fullname="Author">
51
+ </author>
52
+ <date day="1" month="January" year="2000"/>
53
+ <area>first_area &amp; second_area</area>
54
+ </front><middle>
55
+ <section anchor="_section_1" numbered="false">
56
+ <name>Section 1</name>
57
+ <t>Text</t>
58
+ </section>
59
+ </middle>
60
+ </rfc>
61
+ OUTPUT
62
+ end
63
+ end
@@ -0,0 +1,540 @@
1
+ require "spec_helper"
2
+ describe Asciidoctor::RFC::V3::Converter do
3
+ it "renders all options with short author syntax" do
4
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
5
+ = Document title
6
+ :docName:
7
+ John Doe Horton <john.doe@email.com>
8
+
9
+ == Section 1
10
+ Text
11
+ INPUT
12
+ <?xml version="1.0" encoding="US-ASCII"?>
13
+ <!DOCTYPE rfc SYSTEM "rfc2629.dtd">
14
+
15
+ <rfc prepTime="2000-01-01T05:00:00Z" version="3" submissionType="IETF">
16
+ <front>
17
+ <title>Document title</title>
18
+ <author fullname="John Doe Horton" surname="Horton">
19
+ <address>
20
+ <email>john.doe@email.com</email>
21
+ </address>
22
+ </author>
23
+ <date day="1" month="January" year="2000"/>
24
+ </front><middle>
25
+ <section anchor="_section_1" numbered="false">
26
+ <name>Section 1</name>
27
+ <t>Text</t>
28
+ </section>
29
+ </middle>
30
+ </rfc>
31
+ OUTPUT
32
+ end
33
+
34
+ it "renders all options with multiple short author syntax" do
35
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
36
+ = Document title
37
+ :docName:
38
+ John Doe Horton <john.doe@email.com>; Joanna Diva Munez <joanna.munez@email.com>
39
+
40
+ == Section 1
41
+ Text
42
+ INPUT
43
+ <?xml version="1.0" encoding="US-ASCII"?>
44
+ <!DOCTYPE rfc SYSTEM "rfc2629.dtd">
45
+
46
+ <rfc prepTime="2000-01-01T05:00:00Z" version="3" submissionType="IETF">
47
+ <front>
48
+ <title>Document title</title>
49
+ <author fullname="John Doe Horton" surname="Horton">
50
+ <address>
51
+ <email>john.doe@email.com</email>
52
+ </address>
53
+ </author>
54
+ <author fullname="Joanna Diva Munez" surname="Munez">
55
+ <address>
56
+ <email>joanna.munez@email.com</email>
57
+ </address>
58
+ </author>
59
+ <date day="1" month="January" year="2000"/>
60
+ </front><middle>
61
+ <section anchor="_section_1" numbered="false">
62
+ <name>Section 1</name>
63
+ <t>Text</t>
64
+ </section>
65
+ </middle>
66
+ </rfc>
67
+ OUTPUT
68
+ end
69
+
70
+ it "renders all options with long author syntax" do
71
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
72
+ = Document title
73
+ :docName:
74
+ :fullname: John Doe Horton
75
+ :lastname: Horton
76
+ :forename_initials: J. D.
77
+ :role: editor
78
+ :organization: Ribose
79
+ :fax: 555 5555
80
+ :email: john.doe@email.com
81
+ :uri: http://example.com
82
+ :phone: 555 5655
83
+ :street: 57 Mt Pleasant St
84
+ :city: Dullsville
85
+ :region: NSW
86
+ :country: Australia
87
+ :code: 3333
88
+
89
+ == Section 1
90
+ Text
91
+ INPUT
92
+ <?xml version="1.0" encoding="US-ASCII"?>
93
+ <!DOCTYPE rfc SYSTEM "rfc2629.dtd">
94
+
95
+ <rfc prepTime="2000-01-01T05:00:00Z"
96
+ version="3" submissionType="IETF">
97
+ <front>
98
+ <title>Document title</title>
99
+ <author fullname="John Doe Horton" initials="J. D." surname="Horton" role="editor">
100
+ <organization>Ribose</organization>
101
+ <address>
102
+ <postal>
103
+ <street>57 Mt Pleasant St</street>
104
+ <city>Dullsville</city>
105
+ <region>NSW</region>
106
+ <code>3333</code>
107
+ <country>Australia</country>
108
+ </postal>
109
+ <phone>555 5655</phone>
110
+ <facsimile>555 5555</facsimile>
111
+ <email>john.doe@email.com</email>
112
+ <uri>http://example.com</uri>
113
+ </address>
114
+ </author>
115
+ <date day="1" month="January" year="2000"/>
116
+ </front><middle>
117
+ <section anchor="_section_1" numbered="false">
118
+ <name>Section 1</name>
119
+ <t>Text</t>
120
+ </section>
121
+ </middle>
122
+ </rfc>
123
+ OUTPUT
124
+ end
125
+
126
+ it "deals with entities for all options under long author syntax" do
127
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
128
+ = Document title
129
+ :fullname: John <Doe> Horton
130
+ :lastname: Horton & Horton
131
+ :forename_initials: J. & D.
132
+ :organization: Ribose & co.
133
+ :organization_abbrev: RBM & co.
134
+ :fax: <555 5555>
135
+ :email: <john.doe@email.com>
136
+ :uri: http://example.com?x&y
137
+ :phone: 555 5655 & 999
138
+ :street: Cnr Mt Pleasant St & Dullsvile Cnr
139
+ :city: Dullsville & Pleasantville
140
+ :region: NSW & ACT
141
+ :country: Australia & New Zealand
142
+ :code: 3333 & 3334
143
+
144
+ == Section 1
145
+ text
146
+ INPUT
147
+ <?xml version="1.0" encoding="US-ASCII"?>
148
+ <!DOCTYPE rfc SYSTEM "rfc2629.dtd">
149
+
150
+ <rfc submissionType="IETF" prepTime="2000-01-01T05:00:00Z" version="3">
151
+ <front>
152
+ <title>Document title</title>
153
+ <author fullname="John &lt;Doe&gt; Horton" surname="Horton &amp; Horton" initials="J. &amp; D.">
154
+ <organization>Ribose &amp; co.</organization>
155
+ <address>
156
+ <postal>
157
+ <street>Cnr Mt Pleasant St &amp; Dullsvile Cnr</street>
158
+ <city>Dullsville &amp; Pleasantville</city>
159
+ <region>NSW &amp; ACT</region>
160
+ <code>3333 &amp; 3334</code>
161
+ <country>Australia &amp; New Zealand</country>
162
+ </postal>
163
+ <phone>555 5655 &amp; 999</phone>
164
+ <facsimile>&lt;555 5555&gt;</facsimile>
165
+ <email>&lt;john.doe@email.com&gt;</email>
166
+ <uri>http://example.com?x&amp;y</uri>
167
+ </address>
168
+ </author>
169
+ <date day="1" month="January" year="2000"/>
170
+ </front><middle>
171
+ <section anchor="_section_1" numbered="false">
172
+ <name>Section 1</name>
173
+ <t>text</t>
174
+ </section>
175
+ </middle>
176
+ </rfc>
177
+ OUTPUT
178
+ end
179
+
180
+ it "renders all options with multiple long author syntax" do
181
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
182
+ = Document title
183
+ :docName:
184
+ :fullname: John Doe Horton
185
+ :lastname: Horton
186
+ :forename_initials: J. D.
187
+ :role: editor
188
+ :organization: Ribose
189
+ :fax: 555 5555
190
+ :email: john.doe@email.com
191
+ :uri: http://example.com
192
+ :phone: 555 5655
193
+ :street: 57 Mt Pleasant St
194
+ :city: Dullsville
195
+ :region: NSW
196
+ :country: Australia
197
+ :code: 3333
198
+ :fullname_2: Billy Bob Thornton
199
+ :lastname_2: Thornton
200
+ :forename_initials_2: B. B.
201
+ :role_2: editor
202
+ :organization_2: IBM
203
+ :fax_2: 555 6666
204
+ :email_2: billy.thornton@email.com
205
+ :uri_2: http://ibm.com
206
+ :phone_2: 555 6655
207
+ :street_2: 67 Mt Pleasant St
208
+ :city_2: Dulltown
209
+ :region_2: VIC
210
+ :country_2: UK
211
+ :code_2: 44444
212
+
213
+ == Section 1
214
+ Text
215
+ INPUT
216
+ <?xml version="1.0" encoding="US-ASCII"?>
217
+ <!DOCTYPE rfc SYSTEM "rfc2629.dtd">
218
+
219
+ <rfc prepTime="2000-01-01T05:00:00Z"
220
+ version="3" submissionType="IETF">
221
+ <front>
222
+ <title>Document title</title>
223
+ <author fullname="John Doe Horton" initials="J. D." surname="Horton" role="editor">
224
+ <organization>Ribose</organization>
225
+ <address>
226
+ <postal>
227
+ <street>57 Mt Pleasant St</street>
228
+ <city>Dullsville</city>
229
+ <region>NSW</region>
230
+ <code>3333</code>
231
+ <country>Australia</country>
232
+ </postal>
233
+ <phone>555 5655</phone>
234
+ <facsimile>555 5555</facsimile>
235
+ <email>john.doe@email.com</email>
236
+ <uri>http://example.com</uri>
237
+ </address>
238
+ </author>
239
+ <author fullname="Billy Bob Thornton" initials="B. B." surname="Thornton" role="editor">
240
+ <organization>IBM</organization>
241
+ <address>
242
+ <postal>
243
+ <street>67 Mt Pleasant St</street>
244
+ <city>Dulltown</city>
245
+ <region>VIC</region>
246
+ <code>44444</code>
247
+ <country>UK</country>
248
+ </postal>
249
+ <phone>555 6655</phone>
250
+ <facsimile>555 6666</facsimile>
251
+ <email>billy.thornton@email.com</email>
252
+ <uri>http://ibm.com</uri>
253
+ </address>
254
+ </author>
255
+ <date day="1" month="January" year="2000"/>
256
+ </front><middle>
257
+ <section anchor="_section_1" numbered="false">
258
+ <name>Section 1</name>
259
+ <t>Text</t>
260
+ </section>
261
+ </middle>
262
+ </rfc>
263
+ OUTPUT
264
+ end
265
+
266
+ it "respects multiple lines in street" do
267
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
268
+ = Document title
269
+ :docName:
270
+ :fullname: John Doe Horton
271
+ :lastname: Horton
272
+ :forename_initials: J. D.
273
+ :role: editor
274
+ :organization: Ribose
275
+ :fax: 555 5555
276
+ :email: john.doe@email.com
277
+ :uri: http://example.com
278
+ :phone: 555 5655
279
+ :street: 57 Mt Pleasant St\ Technology Park
280
+ :city: Dullsville
281
+ :region: NSW
282
+ :country: Australia
283
+ :code: 3333
284
+
285
+ == Section 1
286
+ Text
287
+ INPUT
288
+ <?xml version="1.0" encoding="US-ASCII"?>
289
+ <!DOCTYPE rfc SYSTEM "rfc2629.dtd">
290
+
291
+ <rfc prepTime="2000-01-01T05:00:00Z"
292
+ version="3" submissionType="IETF">
293
+ <front>
294
+ <title>Document title</title>
295
+ <author fullname="John Doe Horton" initials="J. D." surname="Horton" role="editor">
296
+ <organization>Ribose</organization>
297
+ <address>
298
+ <postal>
299
+ <street>57 Mt Pleasant St</street>
300
+ <street>Technology Park</street>
301
+ <city>Dullsville</city>
302
+ <region>NSW</region>
303
+ <code>3333</code>
304
+ <country>Australia</country>
305
+ </postal>
306
+ <phone>555 5655</phone>
307
+ <facsimile>555 5555</facsimile>
308
+ <email>john.doe@email.com</email>
309
+ <uri>http://example.com</uri>
310
+ </address>
311
+ </author>
312
+ <date day="1" month="January" year="2000"/>
313
+ </front><middle>
314
+ <section anchor="_section_1" numbered="false">
315
+ <name>Section 1</name>
316
+ <t>Text</t>
317
+ </section>
318
+ </middle>
319
+ </rfc>
320
+ OUTPUT
321
+ end
322
+
323
+ it "ignores initials attribute from Asciidoc" do
324
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
325
+ = Document title
326
+ :docName:
327
+ :fullname: John Doe Horton
328
+ :lastname: Horton
329
+ :initials: J. D. H.
330
+ :role: editor
331
+ :organization: Ribose
332
+ :fax: 555 5555
333
+ :email: john.doe@email.com
334
+ :uri: http://example.com
335
+ :phone: 555 5655
336
+ :street: 57 Mt Pleasant St
337
+ :city: Dullsville
338
+ :region: NSW
339
+ :country: Australia
340
+ :code: 3333
341
+
342
+ == Section 1
343
+ Text
344
+ INPUT
345
+ <?xml version="1.0" encoding="US-ASCII"?>
346
+ <!DOCTYPE rfc SYSTEM "rfc2629.dtd">
347
+
348
+ <rfc prepTime="2000-01-01T05:00:00Z"
349
+ version="3" submissionType="IETF">
350
+ <front>
351
+ <title>Document title</title>
352
+ <author fullname="John Doe Horton" surname="Horton" role="editor">
353
+ <organization>Ribose</organization>
354
+ <address>
355
+ <postal>
356
+ <street>57 Mt Pleasant St</street>
357
+ <city>Dullsville</city>
358
+ <region>NSW</region>
359
+ <code>3333</code>
360
+ <country>Australia</country>
361
+ </postal>
362
+ <phone>555 5655</phone>
363
+ <facsimile>555 5555</facsimile>
364
+ <email>john.doe@email.com</email>
365
+ <uri>http://example.com</uri>
366
+ </address>
367
+ </author>
368
+ <date day="1" month="January" year="2000"/>
369
+ </front><middle>
370
+ <section anchor="_section_1" numbered="false">
371
+ <name>Section 1</name>
372
+ <t>Text</t>
373
+ </section>
374
+ </middle>
375
+ </rfc>
376
+ OUTPUT
377
+ end
378
+
379
+ it "permits corporate authors" do
380
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
381
+ = Document title
382
+ :docName:
383
+ :role: editor
384
+ :organization: Ribose
385
+ :fax: 555 5555
386
+ :email: john.doe@email.com
387
+ :uri: http://example.com
388
+ :phone: 555 5655
389
+ :street: 57 Mt Pleasant St
390
+ :city: Dullsville
391
+ :region: NSW
392
+ :country: Australia
393
+ :code: 3333
394
+
395
+ == Section 1
396
+ Text
397
+ INPUT
398
+ <?xml version="1.0" encoding="US-ASCII"?>
399
+ <!DOCTYPE rfc SYSTEM "rfc2629.dtd">
400
+
401
+ <rfc prepTime="2000-01-01T05:00:00Z"
402
+ version="3" submissionType="IETF">
403
+ <front>
404
+ <title>Document title</title>
405
+ <author role="editor">
406
+ <organization>Ribose</organization>
407
+ <address>
408
+ <postal>
409
+ <street>57 Mt Pleasant St</street>
410
+ <city>Dullsville</city>
411
+ <region>NSW</region>
412
+ <code>3333</code>
413
+ <country>Australia</country>
414
+ </postal>
415
+ <phone>555 5655</phone>
416
+ <facsimile>555 5555</facsimile>
417
+ <email>john.doe@email.com</email>
418
+ <uri>http://example.com</uri>
419
+ </address>
420
+ </author>
421
+ <date day="1" month="January" year="2000"/>
422
+ </front><middle>
423
+ <section anchor="_section_1" numbered="false">
424
+ <name>Section 1</name>
425
+ <t>Text</t>
426
+ </section>
427
+ </middle>
428
+ </rfc>
429
+ OUTPUT
430
+ end
431
+
432
+ it "respects postal line attributes, with multiple lines" do
433
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
434
+ = Document title
435
+ :docName:
436
+ :fullname: John Doe Horton
437
+ :lastname: Horton
438
+ :initials: J. D. H.
439
+ :role: editor
440
+ :organization: Ribose
441
+ :fax: 555 5555
442
+ :email: john.doe@email.com
443
+ :uri: http://example.com
444
+ :phone: 555 5655
445
+ :postal-line: 57 Mt Pleasant St\ Dullsville\ NSW\ Australia\ 3333
446
+
447
+ == Section 1
448
+ Text
449
+ INPUT
450
+ <?xml version="1.0" encoding="US-ASCII"?>
451
+ <!DOCTYPE rfc SYSTEM "rfc2629.dtd">
452
+
453
+ <rfc prepTime="2000-01-01T05:00:00Z"
454
+ version="3" submissionType="IETF">
455
+ <front>
456
+ <title>Document title</title>
457
+ <author fullname="John Doe Horton" surname="Horton" role="editor">
458
+ <organization>Ribose</organization>
459
+ <address>
460
+ <postal>
461
+ <postalLine>57 Mt Pleasant St</postalLine>
462
+ <postalLine>Dullsville</postalLine>
463
+ <postalLine>NSW</postalLine>
464
+ <postalLine>Australia</postalLine>
465
+ <postalLine>3333</postalLine>
466
+ </postal>
467
+ <phone>555 5655</phone>
468
+ <facsimile>555 5555</facsimile>
469
+ <email>john.doe@email.com</email>
470
+ <uri>http://example.com</uri>
471
+ </address>
472
+ </author>
473
+ <date day="1" month="January" year="2000"/>
474
+ </front><middle>
475
+ <section anchor="_section_1" numbered="false">
476
+ <name>Section 1</name>
477
+ <t>Text</t>
478
+ </section>
479
+ </middle>
480
+ </rfc>
481
+ OUTPUT
482
+ end
483
+
484
+ it "gives postal lines priority over address lines" do
485
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
486
+ = Document title
487
+ :docName:
488
+ :fullname: John Doe Horton
489
+ :lastname: Horton
490
+ :initials: J. D. H.
491
+ :role: editor
492
+ :organization: Ribose
493
+ :fax: 555 5555
494
+ :email: john.doe@email.com
495
+ :uri: http://example.com
496
+ :phone: 555 5655
497
+ :postal-line: 57 Mt Pleasant St\ Dullsville\ NSW\ Australia\ 3333
498
+ :street: 57 Mt Pleasant St
499
+ :city: Dullsville
500
+ :region: NSW
501
+ :country: Australia
502
+ :code: 3333
503
+
504
+ == Section 1
505
+ Text
506
+ INPUT
507
+ <?xml version="1.0" encoding="US-ASCII"?>
508
+ <!DOCTYPE rfc SYSTEM "rfc2629.dtd">
509
+
510
+ <rfc prepTime="2000-01-01T05:00:00Z"
511
+ version="3" submissionType="IETF">
512
+ <front>
513
+ <title>Document title</title>
514
+ <author fullname="John Doe Horton" surname="Horton" role="editor">
515
+ <organization>Ribose</organization>
516
+ <address>
517
+ <postal>
518
+ <postalLine>57 Mt Pleasant St</postalLine>
519
+ <postalLine>Dullsville</postalLine>
520
+ <postalLine>NSW</postalLine>
521
+ <postalLine>Australia</postalLine>
522
+ <postalLine>3333</postalLine>
523
+ </postal>
524
+ <phone>555 5655</phone>
525
+ <facsimile>555 5555</facsimile>
526
+ <email>john.doe@email.com</email>
527
+ <uri>http://example.com</uri>
528
+ </address>
529
+ </author>
530
+ <date day="1" month="January" year="2000"/>
531
+ </front><middle>
532
+ <section anchor="_section_1" numbered="false">
533
+ <name>Section 1</name>
534
+ <t>Text</t>
535
+ </section>
536
+ </middle>
537
+ </rfc>
538
+ OUTPUT
539
+ end
540
+ end