kramdown-rfc2629 1.6.33 → 1.6.35
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-rfc-clean-svg-ids +5 -1
 - data/kramdown-rfc2629.gemspec +1 -1
 - data/lib/kramdown-rfc/rexml-formatters-conservative.rb +38 -0
 - data/lib/kramdown-rfc2629.rb +3 -1
 - metadata +3 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: e499db8e2b4bd1536065dc5813e013ec9169439a8348925a2def7e315af7f3a6
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 9e96e353bb8beb68cb30f0bda6743c1b03e35feaa50de6832a36347e89d767a4
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: f6a1eb287475812891c52bdf6706bfcbbc4e5f14d1a73db20a0c1a8e47fda2b490d8d9b64a2f39e77afddaf663df714e2d27883fcfe7cb2cc4fafa79b206c568
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 1c7cd9dffed2f30da77216b019aa4145c708666b1733f2b7c93635b81bb1b59ae9a036c406c0091bb6ba2eabeaa920869596c6f7966556204b142f5688f3f8a5
         
     | 
| 
         @@ -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 
     | 
    
         
            -
               
     | 
| 
      
 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
         
     | 
    
        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.6. 
     | 
| 
      
 3 
     | 
    
         
            +
              s.version = '1.6.35'
         
     | 
| 
       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
         
     | 
    
        data/lib/kramdown-rfc2629.rb
    CHANGED
    
    | 
         @@ -1183,7 +1183,8 @@ COLORS 
     | 
|
| 
       1183 
1183 
     | 
    
         
             
                  XML_RESOURCE_ORG_MAP = {
         
     | 
| 
       1184 
1184 
     | 
    
         
             
                    "RFC" => ["bibxml", 86400*7, false,
         
     | 
| 
       1185 
1185 
     | 
    
         
             
                              ->(fn, n){ [name = "reference.RFC.#{"%04d" % n.to_i}.xml",
         
     | 
| 
       1186 
     | 
    
         
            -
                                          "https:// 
     | 
| 
      
 1186 
     | 
    
         
            +
                                          "https://bib.ietf.org/public/rfc/bibxml/#{name}"] }
         
     | 
| 
      
 1187 
     | 
    
         
            +
            # was                         "https://www.rfc-editor.org/refs/bibxml/#{name}"] }
         
     | 
| 
       1187 
1188 
     | 
    
         
             
                             ],
         
     | 
| 
       1188 
1189 
     | 
    
         
             
                    "I-D" => ["bibxml3", false, false,
         
     | 
| 
       1189 
1190 
     | 
    
         
             
                              ->(fn, n){ [fn,
         
     | 
| 
         @@ -1265,6 +1266,7 @@ COLORS 
     | 
|
| 
       1265 
1266 
     | 
    
         
             
                          d = REXML::Document.new(to_insert)
         
     | 
| 
       1266 
1267 
     | 
    
         
             
                          d.xml_decl.nowrite
         
     | 
| 
       1267 
1268 
     | 
    
         
             
                          d.delete d.doctype
         
     | 
| 
      
 1269 
     | 
    
         
            +
                          d.context[:attribute_quote] = :quote  # Set double-quote as the attribute value delimiter
         
     | 
| 
       1268 
1270 
     | 
    
         
             
                          d.root.attributes["anchor"] = anchor
         
     | 
| 
       1269 
1271 
     | 
    
         
             
                          if t == "RFC" or t == "I-D"
         
     | 
| 
       1270 
1272 
     | 
    
         
             
                            if KRAMDOWN_NO_TARGETS || !KRAMDOWN_KEEP_TARGETS
         
     | 
    
        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. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.6.35
         
     | 
| 
       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- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2023-06-08 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
         
     |