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 +4 -4
- data/kramdown-rfc2629.gemspec +1 -1
- data/lib/kramdown-rfc2629.rb +8 -3
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5b32b21ea6b67eda069c4bb1c102f7e505b91ad149970e76ba182080111242a0
|
|
4
|
+
data.tar.gz: c3236319bb5e66f0f39f65d3b1f174d87fca1b85a22ca79e8b4067a98eb2b450
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3457a313f0b84244f822de4ebc11feb12575db86c10647cfad6a6a0fae91340e1252bf0821959eafce8fc65ca31131b11ae9d3ddf4ac258c3c1d49a1bdcc27ed
|
|
7
|
+
data.tar.gz: d3c8f5fc6d5bf4fe947cb27a4304050682ec7dd14b4199644121a668ddc58f1bba4ff7116f9660b2f22bb0d33ce880b7b987d61a1ce1edfd7f602e372dfbddcb
|
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.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.}
|
data/lib/kramdown-rfc2629.rb
CHANGED
|
@@ -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
|