kramdown-rfc2629 1.6.33 → 1.6.34

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d4c663bed0e8e2dc848a9e532ba201b9e9a26b4090368c0d83f8c518275df710
4
- data.tar.gz: a2ac5d0be0615b41ecd65964ca7dfd61e3163fbb3aa612994fa5ac05ae1504ca
3
+ metadata.gz: dfdd6b2626b4919b9f19421d90541b9f7ec2cf8862e18c3ae5c8c8ba7bf425ba
4
+ data.tar.gz: 7d5a91368fa1aa42e189fb6b9dccd4fbe4439f07ff11833fb02104bf73bdbd94
5
5
  SHA512:
6
- metadata.gz: 90ef1269825ef2b9484fc358cf92fa7ffa1ce255ea6e0b520cf99e98ed9f463551bf060d9af84de1ef87f0bd2e8a12442c4b9dc866858e1ed18bf23d4084829a
7
- data.tar.gz: 840c014bc4efcabb1491e81126f577541bb237b0fa92a06fdaa293556eed480997829a357728da96caadc480347d32ddfb3be76a8e7027c986c775adff9babc7
6
+ metadata.gz: 4b070e6f03fce066242187858977e9a2a6e91ebc12859a6f1571abe3e487681b4fbb85e470c6a52207ec85dcebfce039a8d201bdbe86c70c0af5ddda83250a1f
7
+ data.tar.gz: 6fcc90e3ee7ab1daec870b0b0c704c04108bb6a398a733609ba331bdd0106464623ee6b17a3478c8fab972068b193a9c285b5e7488a866aba888e36e464fd27d
@@ -2,6 +2,7 @@
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
4
  require 'rexml/document'
5
+ require 'kramdown-rfc/rexml-formatters-conservative'
5
6
  require 'kramdown-rfc/svg-id-cleanup'
6
7
 
7
8
  def svg_clean_ids(s)
@@ -10,7 +11,10 @@ def svg_clean_ids(s)
10
11
 
11
12
  svg_id_cleanup(d)
12
13
 
13
- d.to_s
14
+ tr = REXML::Formatters::Conservative.new
15
+ o = ''
16
+ tr.write(d, o)
17
+ o
14
18
  rescue => detail
15
19
  warn "*** Can't clean SVG: #{detail}"
16
20
  d.to_s
@@ -1,6 +1,6 @@
1
1
  spec = Gem::Specification.new do |s|
2
2
  s.name = 'kramdown-rfc2629'
3
- s.version = '1.6.33'
3
+ s.version = '1.6.34'
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.}
@@ -0,0 +1,38 @@
1
+ require 'rexml/document'
2
+
3
+ module REXML
4
+ module Formatters
5
+ # The Conservative formatter writes an XML document that parses to an
6
+ # identical document as the source document. This means that no extra
7
+ # whitespace nodes are inserted, and whitespace within text nodes is
8
+ # preserved. Attributes are not sorted.
9
+ class Conservative < Default
10
+ def initialize
11
+ @indentation = 0
12
+ @level = 0
13
+ @ie_hack = false
14
+ end
15
+
16
+ protected
17
+ def write_element( node, output )
18
+ output << "<#{node.expanded_name}"
19
+
20
+ node.attributes.each_attribute do |attr|
21
+ output << " "
22
+ attr.write( output )
23
+ end unless node.attributes.empty?
24
+
25
+ if node.children.empty?
26
+ output << "/"
27
+ else
28
+ output << ">"
29
+ node.children.each { |child|
30
+ write( child, output )
31
+ }
32
+ output << "</#{node.expanded_name}"
33
+ end
34
+ output << ">"
35
+ end
36
+ end
37
+ end
38
+ end
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.6.33
4
+ version: 1.6.34
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carsten Bormann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-30 00:00:00.000000000 Z
11
+ date: 2023-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kramdown
@@ -182,6 +182,7 @@ files:
182
182
  - lib/kramdown-rfc/kdrfc-processor.rb
183
183
  - lib/kramdown-rfc/parameterset.rb
184
184
  - lib/kramdown-rfc/refxml.rb
185
+ - lib/kramdown-rfc/rexml-formatters-conservative.rb
185
186
  - lib/kramdown-rfc/rfc8792.rb
186
187
  - lib/kramdown-rfc/svg-id-cleanup.rb
187
188
  - lib/kramdown-rfc2629.rb