kramdown-rfc2629 1.7.17 → 1.7.18
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.
- checksums.yaml +4 -4
- data/data/kramdown-rfc2629.erb +17 -4
- data/kramdown-rfc2629.gemspec +1 -1
- data/lib/kramdown-rfc/command.rb +16 -4
- data/lib/kramdown-rfc2629.rb +10 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2293add21de7f2adbd52f281c96186e5f5b5abc6be095cc5416eb2a8edb2a482
|
4
|
+
data.tar.gz: c4be0e44b23064c5462e7b9fc677472ff7a87be8f797cef028748cafde8f2621
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8acb9cfb46cc5fbfa2413bbd86bcde74998a99f21481cb910173205564d973a0329bd33574508df0e1f6317826c9da76672ae70c8b990525b0bb2186af79338
|
7
|
+
data.tar.gz: 0ee95eeaf8a6074923e41d47836b702e332f6b6719b78ff4d1cdd348cc1887c2229c93060a4f1456630a0b7960bb330fd0b0d1fb86e89b00045ed34d33f5914f
|
data/data/kramdown-rfc2629.erb
CHANGED
@@ -163,6 +163,7 @@
|
|
163
163
|
{:/nomarkdown}
|
164
164
|
{:quote: gi="blockquote"}
|
165
165
|
{:aside: gi="aside"}
|
166
|
+
{:cref: gi="cref"}
|
166
167
|
{:markers: sourcecode-markers="true"}
|
167
168
|
{:unnumbered: numbered="false"}
|
168
169
|
{:vspace: vspace="0"}
|
@@ -182,22 +183,34 @@
|
|
182
183
|
<displayreference target="<%=k%>" to="<%=v%>"/>
|
183
184
|
<% end -%>
|
184
185
|
|
185
|
-
<%
|
186
|
+
<% shn = sechash.delete("normative")
|
187
|
+
shi = sechash.delete("informative")
|
188
|
+
shc = shn && shi
|
189
|
+
if shc
|
190
|
+
-%>
|
191
|
+
<references title='References' anchor="sec-combined-references">
|
192
|
+
<% end -%>
|
193
|
+
|
194
|
+
<% if shn -%>
|
186
195
|
<references title='Normative References' anchor="sec-normative-references">
|
187
196
|
|
188
|
-
<%=
|
197
|
+
<%= shn %>
|
189
198
|
|
190
199
|
</references>
|
191
200
|
<% end -%>
|
192
201
|
|
193
|
-
<% if
|
202
|
+
<% if shi -%>
|
194
203
|
<references title='Informative References' anchor="sec-informative-references">
|
195
204
|
|
196
|
-
<%=
|
205
|
+
<%= shi %>
|
197
206
|
|
198
207
|
</references>
|
199
208
|
<% end -%>
|
200
209
|
|
210
|
+
<% if shc -%>
|
211
|
+
</references>
|
212
|
+
<% end -%>
|
213
|
+
|
201
214
|
<%= sechash.delete("back") %>
|
202
215
|
<% sh = sechash.delete("contributor") -%>
|
203
216
|
<% consec = ps.has("contributor") -%>
|
data/kramdown-rfc2629.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
spec = Gem::Specification.new do |s|
|
2
2
|
s.name = 'kramdown-rfc2629'
|
3
|
-
s.version = '1.7.
|
3
|
+
s.version = '1.7.18'
|
4
4
|
s.summary = "Kramdown extension for generating RFCXML (RFC 799x)."
|
5
5
|
s.description = %{An RFCXML (RFC 799x) generating backend for Thomas Leitner's
|
6
6
|
"kramdown" markdown parser. Mostly useful for RFC writers.}
|
data/lib/kramdown-rfc/command.rb
CHANGED
@@ -70,8 +70,8 @@ end
|
|
70
70
|
def boilerplate(key)
|
71
71
|
ret = ''
|
72
72
|
case key.downcase
|
73
|
-
when /\Abcp14(info)?(\+)?(-tagged)?(-bcp)?\z/i
|
74
|
-
# $1 $2 $3 $4
|
73
|
+
when /\Abcp14(info)?(\+)?(-tagged)?(-bcp(14)?)?\z/i
|
74
|
+
# $1 $2 $3 $4 $5
|
75
75
|
if $1
|
76
76
|
ret << <<RFC8174ise
|
77
77
|
Although this document is not an IETF Standards Track publication, it
|
@@ -110,11 +110,19 @@ PLUS
|
|
110
110
|
TAGGED
|
111
111
|
end
|
112
112
|
if $4 # experimental; idnits complains:
|
113
|
+
if $5
|
114
|
+
# ** The document contains RFC2119-like boilerplate, but doesn't seem to
|
115
|
+
# mention RFC 2119. The boilerplate contains a reference [BCP14], but that
|
116
|
+
# reference does not seem to mention RFC 2119 either.
|
117
|
+
ret.sub!("BCP 14 {{!RFC2119}} {{!RFC8174}}",
|
118
|
+
"{{!BCP14}} ({{RFC2119}}) ({{RFC8174}})")
|
119
|
+
else
|
113
120
|
# ** The document seems to lack a both a reference to RFC 2119 and the
|
114
121
|
# recommended RFC 2119 boilerplate, even if it appears to use RFC 2119
|
115
122
|
# keywords -- however, there's a paragraph with a matching beginning.
|
116
123
|
# Boilerplate error?
|
117
|
-
|
124
|
+
ret.sub!("{{!RFC2119}} {{!RFC8174}}", "{{!BCP14}}")
|
125
|
+
end
|
118
126
|
end
|
119
127
|
ret
|
120
128
|
when /\Arfc\s*7942(info)?\z/i
|
@@ -376,6 +384,7 @@ def xml_from_sections(input)
|
|
376
384
|
v.gsub!(/{{(#{
|
377
385
|
spacify_re(XSR_PREFIX)
|
378
386
|
})?([\w.\/_\-]+@)?(?:([?!])(-)?|(-))([\w._\-]+)(?:=([\w.\/_\-]+))?(#{
|
387
|
+
# 2 3 4 5 6 7
|
379
388
|
XREF_TXT_SUFFIX
|
380
389
|
})?(#{
|
381
390
|
spacify_re(XSR_SUFFIX)
|
@@ -459,6 +468,9 @@ def xml_from_sections(input)
|
|
459
468
|
sechash[sn.to_s] << %{&#{bts};\n} # ???
|
460
469
|
end
|
461
470
|
else
|
471
|
+
if v.nil? && (bri = bibref.to_i) != 0
|
472
|
+
v = bri
|
473
|
+
end # hack in {{?Err6543=8610}}
|
462
474
|
if v && Integer === v
|
463
475
|
case href
|
464
476
|
when /\AErr(.*)/
|
@@ -478,7 +490,7 @@ def xml_from_sections(input)
|
|
478
490
|
end
|
479
491
|
end
|
480
492
|
unless v && Hash === v
|
481
|
-
warn "*** don't know how to expand ref #{k}"
|
493
|
+
warn "*** don't know how to expand ref #{k} #{v.inspect}"
|
482
494
|
next
|
483
495
|
end
|
484
496
|
if bts && !v.delete("override")
|
data/lib/kramdown-rfc2629.rb
CHANGED
@@ -32,6 +32,7 @@ class Object
|
|
32
32
|
end
|
33
33
|
|
34
34
|
module Kramdown
|
35
|
+
RFCXML_SPAN_ELEMENTS = Set.new(Kramdown::Parser::Html::Constants::HTML_SPAN_ELEMENTS)
|
35
36
|
|
36
37
|
Kramdown::Options.define(:ol_start_at_first_marker, Kramdown::Options::Boolean, false, <<~EOF)
|
37
38
|
If this option is `true`, an ordered list (<ol) will use the
|
@@ -837,7 +838,12 @@ COLORS
|
|
837
838
|
if $options.v3
|
838
839
|
gi = el.attr.delete('gi')
|
839
840
|
if gi && gi != 'ul'
|
840
|
-
|
841
|
+
if RFCXML_SPAN_ELEMENTS === gi
|
842
|
+
text.sub!(/\A\s*<t>(.*)<\/t>\s*\z/) {$1} # XXX unwrap inner text from block
|
843
|
+
"#{' '*indent}<t><#{gi}#{el_html_attributes(el)}>#{text}</#{gi}></t>\n"
|
844
|
+
else
|
845
|
+
"#{' '*indent}<#{gi}#{el_html_attributes(el)}>\n#{text}#{' '*indent}</#{gi}>\n"
|
846
|
+
end
|
841
847
|
else
|
842
848
|
"#{' '*indent}<ul#{el_html_attributes_with(el, {"empty" => 'true'})}><li>\n#{text}#{' '*indent}</li></ul>\n"
|
843
849
|
end
|
@@ -876,6 +882,9 @@ COLORS
|
|
876
882
|
clean = ''
|
877
883
|
parts.each do |p|
|
878
884
|
next if p.empty?
|
885
|
+
if p == "<br />"
|
886
|
+
p = "\u2028" # XXX
|
887
|
+
end
|
879
888
|
d = REXML::Document.new("<foo>#{p}</foo>")
|
880
889
|
t = REXML::XPath.each(d.root, "//text()").to_a.join
|
881
890
|
if t != p
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kramdown-rfc2629
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carsten Bormann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: kramdown
|