kramdown-rfc2629 1.7.40 → 1.7.41

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
  SHA256:
3
- metadata.gz: 8169f0e77f49dec5dd3ebe8880bb1329ed159ea5553d76f68eb4ff3d9425f8e4
4
- data.tar.gz: dbd77ffa24df6367900d97eb5835abfd0bc1fb3164865718e3e5b48b91251c09
3
+ metadata.gz: 5b32b21ea6b67eda069c4bb1c102f7e505b91ad149970e76ba182080111242a0
4
+ data.tar.gz: c3236319bb5e66f0f39f65d3b1f174d87fca1b85a22ca79e8b4067a98eb2b450
5
5
  SHA512:
6
- metadata.gz: 8fe768ffe85a62f7a2d15e976f5e00403d7aeaca282276d1ce4ddbe788c29b2fc6beb4edab9c93c817589b589ec1af68ebb2b50d1b9c6b05fa5bbc8d71090553
7
- data.tar.gz: 862c708667b6cc2d62de66eec9254b16ba2395afd5d0e109e72e6baa1ac78c737c1ffe1c7d2e977f005ddd7d10de97706daf2e4448b46886061198bf918b3542
6
+ metadata.gz: 3457a313f0b84244f822de4ebc11feb12575db86c10647cfad6a6a0fae91340e1252bf0821959eafce8fc65ca31131b11ae9d3ddf4ac258c3c1d49a1bdcc27ed
7
+ data.tar.gz: d3c8f5fc6d5bf4fe947cb27a4304050682ec7dd14b4199644121a668ddc58f1bba4ff7116f9660b2f22bb0d33ce880b7b987d61a1ce1edfd7f602e372dfbddcb
@@ -1,6 +1,6 @@
1
1
  spec = Gem::Specification.new do |s|
2
2
  s.name = 'kramdown-rfc2629'
3
- s.version = '1.7.40'
3
+ s.version = '1.7.41'
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.}
@@ -109,8 +109,8 @@ module Kramdown
109
109
  XREF_TXT = /(?:[^\(]|\([^\)]*\))+/ # parenthesized text
110
110
  XREF_RE = /#{XREF_BASE}(?: \(#{XREF_TXT}\))?/
111
111
  XREF_RE_M = /\A(#{XREF_BASE})(?: \((#{XREF_TXT})\))?/ # matching version of XREF_RE
112
- XREF_SINGLE = /(?:Section|Appendix) #{XREF_RE}/
113
- XREF_MULTI = /(?:Sections|Appendices) (?:#{XREF_RE}, )*#{XREF_RE},? and #{XREF_RE}/
112
+ XREF_SINGLE = /(?:Section|Appendix|Table|Figure) #{XREF_RE}/
113
+ XREF_MULTI = /(?:Sections|Appendices|Tables|Figures) (?:#{XREF_RE}, )*#{XREF_RE},? and #{XREF_RE}/
114
114
  XREF_ANY = /(?:#{XREF_SINGLE}|#{XREF_MULTI})/
115
115
  SECTIONS_RE = /(?:#{XREF_ANY} and )?#{XREF_ANY}/
116
116
 
@@ -138,6 +138,8 @@ module Kramdown
138
138
  return
139
139
  end
140
140
 
141
+ reftype = s.match(/\A\w+/).to_s
142
+ issection = /[SA]/ =~ reftype[0]
141
143
  href = href.split(' ')[0] # Remove any trailing (...)
142
144
  target1, target2 = href.split("@", 2)
143
145
  multi = last_join != nil
@@ -146,7 +148,7 @@ module Kramdown
146
148
  m = s.match(/\A#{XREF_RE_M}(, (?:and )?| and )?/)
147
149
  break if not m
148
150
 
149
- if not multi and not m[2] and not m[3] and not target2
151
+ if not multi and not m[2] and not m[3] and not target2 and issection
150
152
  # Modify |attr| if there is a single reference. This can only be
151
153
  # used if there is only one section reference and the section part
152
154
  # has no title.
@@ -165,6 +167,9 @@ module Kramdown
165
167
  s[m[0]] = ''
166
168
 
167
169
  attr1 = { 'target' => target1, 'section' => m[1], 'sectionFormat' => 'bare', 'text' => m[2] }
170
+ if !issection
171
+ attr1['relative'] = "##{reftype.downcase.chomp('s')}-#{m[1]}"
172
+ end
168
173
  @tree.children << Element.new(:xref, nil, attr1)
169
174
  andof = m[3] || last_join || " of "
170
175
  if andof == " of " && target2
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.7.40
4
+ version: 1.7.41
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carsten Bormann