kramdown-rfc2629 1.7.7 → 1.7.9
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/README.md +4 -3
 - data/kramdown-rfc2629.gemspec +1 -1
 - data/lib/kramdown-rfc/command.rb +4 -0
 - data/lib/kramdown-rfc2629.rb +58 -2
 - metadata +3 -3
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 19205d36d58adcb319445d107550e706df01dec57b2b11ae8d83bcf98ba0f692
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: afb2233b556ee2e8906a39726f9e974784bd3cf48f294b1c492dcc257e545fc9
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: ab0627eb9f1484f16fa7a3ef6653f2289c6b7e569ba13a2e4b9de00e961e981558ebd2ef06e6dda4f504c04fbab65f4427575ac5f1c5afbebcee27af17366ebd
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: ff634b58a990bad533c3e47a72fc428c1a61e8976aa87e2cdab977bc896ac7400aadbd17ef2c005c3bf0665f93c92a044e54ae6c25b6049949b4b314b7fb9adf
         
     | 
    
        data/README.md
    CHANGED
    
    | 
         @@ -180,7 +180,7 @@ and then just write `{{RFC2119}}` or `{{RFC1925}}`.  (Yes, there is a 
     | 
|
| 
       180 
180 
     | 
    
         
             
            colon in the YAML, because this is a hash that could provide other
         
     | 
| 
       181 
181 
     | 
    
         
             
            information.)
         
     | 
| 
       182 
182 
     | 
    
         | 
| 
       183 
     | 
    
         
            -
            Since version 1.1, references imported from the [ 
     | 
| 
      
 183 
     | 
    
         
            +
            Since version 1.1, references imported from the [BibXML][] databases
         
     | 
| 
       184 
184 
     | 
    
         
             
            can be supplied with a replacement label (anchor name).  E.g., RFC 793
         
     | 
| 
       185 
185 
     | 
    
         
             
            could be referenced as `{{!TCP=RFC0793}}`, further references then just
         
     | 
| 
       186 
186 
     | 
    
         
             
            can say `{{TCP}}`; both will get `[TCP]` as the label.  In the
         
     | 
| 
         @@ -205,7 +205,7 @@ Notes about this feature: 
     | 
|
| 
       205 
205 
     | 
    
         
             
              maintaining live references then may require some manual editing to
         
     | 
| 
       206 
206 
     | 
    
         
             
              get rid of the custom anchors.
         
     | 
| 
       207 
207 
     | 
    
         | 
| 
       208 
     | 
    
         
            -
            If your references are not in the [ 
     | 
| 
      
 208 
     | 
    
         
            +
            If your references are not in the [BibXML][] databases and do not
         
     | 
| 
       209 
209 
     | 
    
         
             
            have a DOI (that also happens to have correct data) either, you need
         
     | 
| 
       210 
210 
     | 
    
         
             
            to spell it out like in the examples below:
         
     | 
| 
       211 
211 
     | 
    
         | 
| 
         @@ -667,7 +667,7 @@ made it possible to license kramdown-rfc under the same license. 
     | 
|
| 
       667 
667 
     | 
    
         
             
            [IETF]: http://www.ietf.org
         
     | 
| 
       668 
668 
     | 
    
         
             
            [Miek Gieben]: http://www.miek.nl/
         
     | 
| 
       669 
669 
     | 
    
         
             
            [pandoc2rfc]: https://github.com/miekg/pandoc2rfc/
         
     | 
| 
       670 
     | 
    
         
            -
            [XML2RFC]:  
     | 
| 
      
 670 
     | 
    
         
            +
            [XML2RFC]: https://github.com/ietf-tools/xml2rfc
         
     | 
| 
       671 
671 
     | 
    
         
             
            [RFC 7328]: http://tools.ietf.org/html/rfc7328
         
     | 
| 
       672 
672 
     | 
    
         
             
            [mmark-git]: https://github.com/miekg/mmark
         
     | 
| 
       673 
673 
     | 
    
         
             
            [mmark]: https://mmark.nl
         
     | 
| 
         @@ -676,3 +676,4 @@ made it possible to license kramdown-rfc under the same license. 
     | 
|
| 
       676 
676 
     | 
    
         
             
            [asciidoctor-rfc]: https://github.com/metanorma/asciidoctor-rfc
         
     | 
| 
       677 
677 
     | 
    
         
             
            [asciidoc]: http://www.methods.co.nz/asciidoc/
         
     | 
| 
       678 
678 
     | 
    
         
             
            [orgmode]: http://orgmode.org
         
     | 
| 
      
 679 
     | 
    
         
            +
            [BibXML]: https://bib.ietf.org/
         
     | 
    
        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.9'
         
     | 
| 
       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
    
    | 
         @@ -579,6 +579,10 @@ end 
     | 
|
| 
       579 
579 
     | 
    
         
             
            warn "*** v2 #{$options.v2.inspect} v3 #{$options.v3.inspect}" if $options.verbose
         
     | 
| 
       580 
580 
     | 
    
         | 
| 
       581 
581 
     | 
    
         
             
            input = ARGF.read
         
     | 
| 
      
 582 
     | 
    
         
            +
            input.scrub! do |c|
         
     | 
| 
      
 583 
     | 
    
         
            +
              warn "*** replaced invalid UTF-8 byte sequence #{c.inspect} by U+FFFD REPLACEMENT CHARACTER"
         
     | 
| 
      
 584 
     | 
    
         
            +
              0xFFFD.chr(Encoding::UTF_8)
         
     | 
| 
      
 585 
     | 
    
         
            +
            end
         
     | 
| 
       582 
586 
     | 
    
         
             
            if input[0] == "\uFEFF"
         
     | 
| 
       583 
587 
     | 
    
         
             
               warn "*** There is a leading byte order mark. Ignored."
         
     | 
| 
       584 
588 
     | 
    
         
             
               input[0..0] = ''
         
     | 
    
        data/lib/kramdown-rfc2629.rb
    CHANGED
    
    | 
         @@ -33,6 +33,44 @@ end 
     | 
|
| 
       33 
33 
     | 
    
         | 
| 
       34 
34 
     | 
    
         
             
            module Kramdown
         
     | 
| 
       35 
35 
     | 
    
         | 
| 
      
 36 
     | 
    
         
            +
              Kramdown::Options.define(:nested_ol_types, Object, %w[1], <<~EOF) do |val|
         
     | 
| 
      
 37 
     | 
    
         
            +
                  Values for type= attribute for nested ordered lists (ol).
         
     | 
| 
      
 38 
     | 
    
         
            +
                  The value needs to be an array of <ol type= values, expressed as one of:
         
     | 
| 
      
 39 
     | 
    
         
            +
                  1. A YAML array
         
     | 
| 
      
 40 
     | 
    
         
            +
                  2. A string that will be split on commas (with optional blank space following)
         
     | 
| 
      
 41 
     | 
    
         
            +
                  3. A string that will be split on blank space
         
     | 
| 
      
 42 
     | 
    
         
            +
             
     | 
| 
      
 43 
     | 
    
         
            +
                  Default: ["1"]
         
     | 
| 
      
 44 
     | 
    
         
            +
                  Used by: RFCXML converter
         
     | 
| 
      
 45 
     | 
    
         
            +
                EOF
         
     | 
| 
      
 46 
     | 
    
         
            +
                val = case val
         
     | 
| 
      
 47 
     | 
    
         
            +
                      when String
         
     | 
| 
      
 48 
     | 
    
         
            +
                        if val[0] == "[" && val[-1] == "]"
         
     | 
| 
      
 49 
     | 
    
         
            +
                          begin
         
     | 
| 
      
 50 
     | 
    
         
            +
                            val = YAML.safe_load(val)
         
     | 
| 
      
 51 
     | 
    
         
            +
                          rescue Psych::SyntaxError
         
     | 
| 
      
 52 
     | 
    
         
            +
                            warn "** YAML syntax error in nested_ol_types=#{val.inspect}"
         
     | 
| 
      
 53 
     | 
    
         
            +
                            val = %w[1]
         
     | 
| 
      
 54 
     | 
    
         
            +
                          end
         
     | 
| 
      
 55 
     | 
    
         
            +
                        else
         
     | 
| 
      
 56 
     | 
    
         
            +
                          val = val.split(/, */)
         
     | 
| 
      
 57 
     | 
    
         
            +
                          val = val[0].split(/ +/) if val.size == 1
         
     | 
| 
      
 58 
     | 
    
         
            +
                        end
         
     | 
| 
      
 59 
     | 
    
         
            +
                        Kramdown::Options.simple_array_validator(val, :nested_ol_types)
         
     | 
| 
      
 60 
     | 
    
         
            +
                      when Array
         
     | 
| 
      
 61 
     | 
    
         
            +
                        val.map!{ |x| x.to_s }
         
     | 
| 
      
 62 
     | 
    
         
            +
                        val = Kramdown::Options.simple_array_validator(val, :nested_ol_types)
         
     | 
| 
      
 63 
     | 
    
         
            +
                      else
         
     | 
| 
      
 64 
     | 
    
         
            +
                        raise Kramdown::Error, "Invalid value for option '#{:nested_ol_types}': '#{val.inspect}'"
         
     | 
| 
      
 65 
     | 
    
         
            +
                      end
         
     | 
| 
      
 66 
     | 
    
         
            +
                if val == []
         
     | 
| 
      
 67 
     | 
    
         
            +
                  val = %w[1]
         
     | 
| 
      
 68 
     | 
    
         
            +
                  warn "** Option #{:nested_ol_types} cannot be empty, defaulting to #{val.inspect}"
         
     | 
| 
      
 69 
     | 
    
         
            +
                end
         
     | 
| 
      
 70 
     | 
    
         
            +
                val
         
     | 
| 
      
 71 
     | 
    
         
            +
              end
         
     | 
| 
      
 72 
     | 
    
         
            +
             
     | 
| 
      
 73 
     | 
    
         
            +
             
     | 
| 
       36 
74 
     | 
    
         
             
              module Parser
         
     | 
| 
       37 
75 
     | 
    
         | 
| 
       38 
76 
     | 
    
         
             
                class RFC2629Kramdown < Kramdown
         
     | 
| 
         @@ -347,7 +385,10 @@ module Kramdown 
     | 
|
| 
       347 
385 
     | 
    
         
             
                    location + @location_delta + @location_correction
         
     | 
| 
       348 
386 
     | 
    
         
             
                  end
         
     | 
| 
       349 
387 
     | 
    
         | 
| 
       350 
     | 
    
         
            -
                  def convert(el 
     | 
| 
      
 388 
     | 
    
         
            +
                  def convert(el)
         
     | 
| 
      
 389 
     | 
    
         
            +
                    opts = el.options[:options]
         
     | 
| 
      
 390 
     | 
    
         
            +
                    # warn "** tree opts #{opts.inspect}"
         
     | 
| 
      
 391 
     | 
    
         
            +
                    indent = -INDENTATION
         
     | 
| 
       351 
392 
     | 
    
         
             
                    if el.children[-1].type == :raw
         
     | 
| 
       352 
393 
     | 
    
         
             
                      raw = convert1(el.children.pop, indent, opts)
         
     | 
| 
       353 
394 
     | 
    
         
             
                    end
         
     | 
| 
         @@ -872,7 +913,22 @@ COLORS 
     | 
|
| 
       872 
913 
     | 
    
         
             
                      "#{' '*indent}<t><list#{attrstring}>\n#{inner(el, indent, opts)}#{' '*indent}</list></t>\n"
         
     | 
| 
       873 
914 
     | 
    
         
             
                    end
         
     | 
| 
       874 
915 
     | 
    
         
             
                  end
         
     | 
| 
       875 
     | 
    
         
            -
             
     | 
| 
      
 916 
     | 
    
         
            +
             
     | 
| 
      
 917 
     | 
    
         
            +
                  def convert_ol(el, indent, opts)
         
     | 
| 
      
 918 
     | 
    
         
            +
                    nested_types = opts[:nested_ol_types] || ["1"]
         
     | 
| 
      
 919 
     | 
    
         
            +
                    # warn "** ol opts #{opts.inspect} types #{nested_types.inspect}"
         
     | 
| 
      
 920 
     | 
    
         
            +
                    if nested_attr = el.attr.delete('nestedOlTypes')
         
     | 
| 
      
 921 
     | 
    
         
            +
                      nested_types = ::Kramdown::Options.parse(:nested_ol_types, nested_attr)
         
     | 
| 
      
 922 
     | 
    
         
            +
                    end
         
     | 
| 
      
 923 
     | 
    
         
            +
                    if nested_types = nested_types.dup
         
     | 
| 
      
 924 
     | 
    
         
            +
                      # warn "** nested_types #{nested_types.inspect}"
         
     | 
| 
      
 925 
     | 
    
         
            +
                      nested_here = nested_types.shift
         
     | 
| 
      
 926 
     | 
    
         
            +
                      opts = opts.merge(nested_ol_types: nested_types << nested_here)
         
     | 
| 
      
 927 
     | 
    
         
            +
                      el.attr['type'] ||= nested_here
         
     | 
| 
      
 928 
     | 
    
         
            +
                      # warn "** actual ol type #{el.attr['type'].inspect}"
         
     | 
| 
      
 929 
     | 
    
         
            +
                    end
         
     | 
| 
      
 930 
     | 
    
         
            +
                    convert_ul(el, indent, opts)
         
     | 
| 
      
 931 
     | 
    
         
            +
                  end
         
     | 
| 
       876 
932 
     | 
    
         | 
| 
       877 
933 
     | 
    
         
             
                  def convert_dl(el, indent, opts)
         
     | 
| 
       878 
934 
     | 
    
         
             
                    if $options.v3
         
     | 
    
        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.9
         
     | 
| 
       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-04-20 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: kramdown
         
     | 
| 
         @@ -206,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       206 
206 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       207 
207 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       208 
208 
     | 
    
         
             
            requirements: []
         
     | 
| 
       209 
     | 
    
         
            -
            rubygems_version: 3.4 
     | 
| 
      
 209 
     | 
    
         
            +
            rubygems_version: 3.5.4
         
     | 
| 
       210 
210 
     | 
    
         
             
            signing_key:
         
     | 
| 
       211 
211 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       212 
212 
     | 
    
         
             
            summary: Kramdown extension for generating RFCXML (RFC 799x).
         
     |