kramdown-rfc2629 1.2.1 → 1.2.2
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/bin/kramdown-rfc2629 +2 -0
- data/kramdown-rfc2629.gemspec +1 -1
- data/lib/kramdown-rfc/parameterset.rb +10 -2
- data/lib/kramdown-rfc/refxml.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54c66628e2c25917324ce21fc33042dac1bce686
|
4
|
+
data.tar.gz: 9ed9fa9632764192f8f63f6beb32b15780eb1065
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e2998562be631b313be4742a482ad9bf9df8592b8b15b074efeb70d0e9198a3f0ffb24ee5f18e9b5e443d3286bf0037612f80afb9e28952efd4ded6b3f4b735
|
7
|
+
data.tar.gz: 4d012c373dd07b4367faea46e69dcb67661dc80bcb7406383846a6cb0ca70e696b3107e6deadfbc04f55431b163ba4fe775e45fa1504cbcca2e757552fecdf7d
|
data/bin/kramdown-rfc2629
CHANGED
@@ -175,6 +175,8 @@ def xml_from_sections(input)
|
|
175
175
|
if bts && !v.delete("override")
|
176
176
|
warn "*** warning: explicit settings completely override canned bibxml in reference #{k}"
|
177
177
|
end
|
178
|
+
options = {input: 'RFC2629Kramdown', entity_output: coding_override, link_defs: link_defs}
|
179
|
+
$global_markdown_options = options # For recursive calls in bibref annotation processing.
|
178
180
|
sechash[sn.to_s] << KramdownRFC::ref_to_xml(k, v)
|
179
181
|
end
|
180
182
|
end
|
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.2.
|
3
|
+
s.version = '1.2.2'
|
4
4
|
s.summary = "Kramdown extension for generating RFC 7749 XML."
|
5
5
|
s.description = %{An RFC7749 (XML2RFC) generating backend for Thomas Leitner's
|
6
6
|
"kramdown" markdown parser. Mostly useful for RFC writers.}
|
@@ -29,11 +29,19 @@ module KramdownRFC
|
|
29
29
|
def attrs(*pns)
|
30
30
|
pns.map{ |pn| attr(pn) }.compact.join(" ")
|
31
31
|
end
|
32
|
-
def ele(pn, attr=nil, defcontent=nil)
|
32
|
+
def ele(pn, attr=nil, defcontent=nil, markdown=false)
|
33
33
|
val, an = van(pn)
|
34
34
|
val ||= defcontent
|
35
35
|
Array(val).map do |val1|
|
36
|
-
|
36
|
+
v = val1.to_s.strip
|
37
|
+
if markdown # Uuh. Heavy coupling.
|
38
|
+
doc = Kramdown::Document.new(v, $global_markdown_options)
|
39
|
+
$stderr.puts doc.warnings.to_yaml unless doc.warnings.empty?
|
40
|
+
contents = doc.to_rfc2629[3..-6] # skip <t>...</t>\n
|
41
|
+
else
|
42
|
+
contents = escape_html(v)
|
43
|
+
end
|
44
|
+
%{<#{[an, *Array(attr).map(&:to_s)].join(" ").strip}>#{contents}</#{an}>}
|
37
45
|
end.join(" ")
|
38
46
|
end
|
39
47
|
def arr(an, converthash=true, must_have_one=false, &block)
|
data/lib/kramdown-rfc/refxml.rb
CHANGED
@@ -29,7 +29,7 @@ module KramdownRFC
|
|
29
29
|
<% vps.arr("format", false) do |k, v| -%>
|
30
30
|
<format type="<%=escattr(k)%>" target="<%=escattr(v)%>"/>
|
31
31
|
<% end -%>
|
32
|
-
<%= vps.ele("annotation=ann") -%>
|
32
|
+
<%= vps.ele("annotation=ann", nil, nil, true) -%>
|
33
33
|
</reference>
|
34
34
|
REFERB
|
35
35
|
ret = erb.result(binding)
|