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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3efa3808f2f38df0f1fedac366aa64a6687e9248
4
- data.tar.gz: 9f187fbe91281d7fac747b8a32532cc3b5fd1e01
3
+ metadata.gz: 54c66628e2c25917324ce21fc33042dac1bce686
4
+ data.tar.gz: 9ed9fa9632764192f8f63f6beb32b15780eb1065
5
5
  SHA512:
6
- metadata.gz: 2a16e27dd737f475610c1998e56117783fe26b86903c84babddfd44b74108fb8e353f81e345b3903c9bb4b0756cfbe711a5333815afb2b7071311418ff7cdc91
7
- data.tar.gz: 956c0614ef8389ae73c7a9b2d4d0d2627116b9df505b68b2d1468fbaf16a3b691df642f83bde46af12d8e0d36e4b4b3422bffeb7c992e4ee2068f198955738cb
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
@@ -1,6 +1,6 @@
1
1
  spec = Gem::Specification.new do |s|
2
2
  s.name = 'kramdown-rfc2629'
3
- s.version = '1.2.1'
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
- %{<#{[an, *Array(attr).map(&:to_s)].join(" ").strip}>#{escape_html(val1.to_s.strip)}</#{an}>}
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)
@@ -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)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kramdown-rfc2629
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carsten Bormann