kramdown-rfc2629 1.6.6 → 1.6.9

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: 0665cf9a250a3ccecfd5ffb7c58f2443e8b21e518972714d22098142fef1de8e
4
- data.tar.gz: 24dca25b6ced5deca65ad0baab89eb74e606683b0e2c08afb7de88cdbfc4d5bc
3
+ metadata.gz: a5efefbd462f83ca8a6028732587b93cdcb325dced1d3517c431951a460935ba
4
+ data.tar.gz: 5e419a6c6450b96ef213aa875beb1ebd2a8fab50a7dfbbe3c75f551fd40fb160
5
5
  SHA512:
6
- metadata.gz: 4c579b8fec2e8b0c1aa2b749cbdcc1b70fb850db6d6ca6162b5045c31b8848a780e72ae26bcf9551987002681513d276b04bdc734c5030e068dafca11fd53a19
7
- data.tar.gz: e73d2deed187c22f5f74c2664981fd65e23fa6e83b3ae3779221fe59dc361a3c0807fff74f4155055043fff603c6a29dfb35b8fba7689cf7d5d8f432908eed21
6
+ metadata.gz: c7f4b69d71d42913d164727465b4e998a58ef5df9378e563030ec9edea6028ea55908c41fca51aa6db760d806fa80372a71a83a5b3a134a294b90bc3ad99e5ae
7
+ data.tar.gz: a22265e02addd8fefcc79b40acd864df936147d9c0e3004916e8f0c5649d719970e4a19772f47a70d92051efa50f0dcde2771d7f8994c15536d8ed8d8143fd19
data/bin/de-gfm CHANGED
@@ -5,19 +5,22 @@ Encoding.default_external = "UTF-8" # wake up, smell the coffee
5
5
  require 'kramdown'
6
6
  require 'kramdown-parser-gfm'
7
7
 
8
- if ARGV[0] == '-k' # kramdown
9
- MARKDOWN_BR = "\\\\\n"
8
+ options = ''
9
+ while /\A-([4bck]+)\z/ === ARGV[0]
10
10
  ARGV.shift
11
+ options << $1
12
+ end
13
+
14
+ if /k/ === options # kramdown
15
+ MARKDOWN_BR = "\\\\\n"
11
16
  end
12
17
 
13
- if ARGV[0] == '-c' # commonmark
18
+ if /c/ === options # commonmark
14
19
  MARKDOWN_BR = "\\\n"
15
- ARGV.shift
16
20
  end
17
21
 
18
- if ARGV[0] == '-b' # universal HTML
22
+ if /b/ === options # universal HTML
19
23
  MARKDOWN_BR = "<br/>\n"
20
- ARGV.shift
21
24
  end
22
25
 
23
26
  MARKDOWN_BR ||= " \n" # original Gruber
@@ -37,4 +40,9 @@ module Kramdown
37
40
  end
38
41
  end
39
42
 
40
- puts Kramdown::Document.new(ARGF.read, input: 'GFM', gfm_quirks: 'paragraph_end').to_kramdown
43
+ list_indent = 2
44
+ list_indent = 4 if /4/ === options
45
+
46
+ doc = Kramdown::Document.new(ARGF.read, input: 'GFM', gfm_quirks: 'paragraph_end',
47
+ list_indent: list_indent)
48
+ puts doc.to_kramdown
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="<%=ps[:coding]||"UTF-8"%>"?>
2
2
  <?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
3
- <!-- generated by https://github.com/cabo/kramdown-rfc2629 version <%=
3
+ <!-- generated by https://github.com/cabo/kramdown-rfc version <%=
4
4
  Gem.loaded_specs["kramdown-rfc2629"].version rescue nil
5
5
  %> (Ruby <%= RUBY_VERSION %>) -->
6
6
 
@@ -29,7 +29,7 @@
29
29
  ps["consensus"] = true if MUST_CONSENSUS[cat]
30
30
  end
31
31
  rfcattrs = ps.attrs("ipr", "docName=docname", "category=cat",
32
- "consensus", "submissionType=submissiontype", "xml:lang=lang",
32
+ "consensus", "submissionType=submissiontype=stream", "xml:lang=lang",
33
33
  "number", "obsoletes", "updates", "seriesNo=seriesno")
34
34
  TRUE_FALSE = {nil => "true", false => "false", true => "true",
35
35
  "yes" => "true", "no" => "false"}
@@ -1,10 +1,10 @@
1
1
  spec = Gem::Specification.new do |s|
2
2
  s.name = 'kramdown-rfc2629'
3
- s.version = '1.6.6'
3
+ s.version = '1.6.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.}
7
- s.add_dependency('kramdown', '~> 2.3.0')
7
+ s.add_dependency('kramdown', '~> 2.4.0')
8
8
  s.add_dependency('kramdown-parser-gfm', '~> 1.1')
9
9
  s.add_dependency('certified', '~> 1.0')
10
10
  s.add_dependency('json_pure', '~> 2.0')
@@ -18,6 +18,6 @@ spec = Gem::Specification.new do |s|
18
18
  # s.has_rdoc = true
19
19
  s.author = "Carsten Bormann"
20
20
  s.email = "cabo@tzi.org"
21
- s.homepage = "http://github.com/cabo/kramdown-rfc2629"
21
+ s.homepage = "http://github.com/cabo/kramdown-rfc"
22
22
  s.license = 'MIT'
23
23
  end
@@ -485,7 +485,7 @@ Usage: kramdown-rfc2629 [options] file.md|file.mkd > file.xml
485
485
  Version: #{KDRFC_VERSION}
486
486
  BANNER
487
487
  opts.on("-V", "--version", "Show version and exit") do |v|
488
- puts "kramdown-rfc2629 #{KDRFC_VERSION}"
488
+ puts "kramdown-rfc #{KDRFC_VERSION}"
489
489
  exit
490
490
  end
491
491
  opts.on("-H", "--help", "Show option summary and exit") do |v|
@@ -27,13 +27,15 @@ module KramdownRFC
27
27
  def has(pn)
28
28
  @f[pn.to_s]
29
29
  end
30
+ def has?(pn)
31
+ @f.key?(pn.to_s)
32
+ end
30
33
  def escattr(str)
31
34
  escape_html(str.to_s, :attribute)
32
35
  end
33
- def van(pn) # pn is a parameter name, possibly with an =alias
34
- an, pn = pn.to_s.split("=")
35
- pn ||= an
36
- [self[pn] || self[an], an]
36
+ def van(pn) # pn is a parameter name, possibly with =aliases
37
+ names = pn.to_s.split("=")
38
+ [self[names.reverse.find{|nm| has?(nm)}], names.first]
37
39
  end
38
40
  def attr(pn)
39
41
  val, an = van(pn)
@@ -12,7 +12,7 @@ require 'shellwords'
12
12
 
13
13
  raise "sorry, 1.8 was last decade" unless RUBY_VERSION >= '1.9'
14
14
 
15
- gem 'kramdown', '~> 2.3.0'
15
+ gem 'kramdown', '~> 2.4.0'
16
16
  require 'kramdown'
17
17
  my_span_elements = %w{list figure xref eref iref cref spanx vspace}
18
18
  Kramdown::Parser::Html::Constants::HTML_SPAN_ELEMENTS.concat my_span_elements
@@ -113,7 +113,7 @@ module Kramdown
113
113
  end
114
114
  end
115
115
 
116
- XREF_START = /\{\{(?:(?:\{(.*?)\}(?:\{(.*?)\})?)|(\X*?))((?:\}\})|\})/u
116
+ XREF_START = /\{\{(?:(?:\{(.*?\n??.*?)\}(?:\{(.*?\n??.*?)\})?)|(\X*?))((?:\}\})|\})/u
117
117
 
118
118
  # Introduce new {{target}} syntax for empty xrefs, which would
119
119
  # otherwise be an ugly ![!](target) or ![ ](target)
@@ -124,9 +124,9 @@ module Kramdown
124
124
  warn "*** #{@src[0]}: unmatched braces #{@src[4].inspect}"
125
125
  end
126
126
  if contact_name = @src[1]
127
- attr = {'fullname' => contact_name}
127
+ attr = {'fullname' => contact_name.gsub("\n", " ")}
128
128
  if ascii_name = @src[2]
129
- attr["asciiFullname"] = ascii_name
129
+ attr["asciiFullname"] = ascii_name.gsub("\n", " ")
130
130
  end
131
131
  el = Element.new(:contact, nil, attr)
132
132
  else
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.6
4
+ version: 1.6.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: 2022-04-10 00:00:00.000000000 Z
11
+ date: 2022-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kramdown
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.3.0
19
+ version: 2.4.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 2.3.0
26
+ version: 2.4.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: kramdown-parser-gfm
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -105,7 +105,7 @@ files:
105
105
  - lib/kramdown-rfc/refxml.rb
106
106
  - lib/kramdown-rfc/rfc8792.rb
107
107
  - lib/kramdown-rfc2629.rb
108
- homepage: http://github.com/cabo/kramdown-rfc2629
108
+ homepage: http://github.com/cabo/kramdown-rfc
109
109
  licenses:
110
110
  - MIT
111
111
  metadata: {}
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
124
  - !ruby/object:Gem::Version
125
125
  version: '0'
126
126
  requirements: []
127
- rubygems_version: 3.3.7
127
+ rubygems_version: 3.3.11
128
128
  signing_key:
129
129
  specification_version: 4
130
130
  summary: Kramdown extension for generating RFCXML (RFC 799x).