kramdown-rfc2629 1.5.3 → 1.5.4
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 +20 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49968f621678e46d7ecde1451347a63f8a9dd93d0c7dc1f822ee7314f1c7c3fc
|
4
|
+
data.tar.gz: d94a74186a8be6c9880c8e15d73b7961df19ab566a55b5a3a643a34aaa1f3c5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 424d084703c00e29cad08da0ee6f4568ac6861772eef79fadf26c6f39a4747d6ec192f04abf262d3f26579d4e7fb8493d00c34f9cf01183cabec1b3ccbe1bf4a
|
7
|
+
data.tar.gz: f5d6cf7487ce6601bf2cb3198c9d12727d5c4cc0752c5c9b11f6f29a43304874dca36653e047812486888889bc07e0999fad89d3847b0cb1122f0c020f9f33a1
|
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.5.
|
3
|
+
s.version = '1.5.4'
|
4
4
|
s.summary = "Kramdown extension for generating RFC 7749 XML."
|
5
5
|
s.description = %{An RFC7749 (XML2RFC) generating backend for Thomas Leitner's
|
6
6
|
"kramdown" markdown parser. Mostly useful for RFC writers.}
|
data/lib/kramdown-rfc2629.rb
CHANGED
@@ -128,9 +128,14 @@ module Kramdown
|
|
128
128
|
when /\A(.*) \((#{SECTIONS_RE})\)\z/
|
129
129
|
href = $1
|
130
130
|
handle_bares($2, attr, "parens", href)
|
131
|
-
when
|
132
|
-
href = $
|
133
|
-
|
131
|
+
when /#{XREF_RE_M}<(.+)\z/
|
132
|
+
href = $3
|
133
|
+
if $2
|
134
|
+
attr['section'] = $2
|
135
|
+
attr['relative'] = "#" << $1
|
136
|
+
else
|
137
|
+
attr['section'] = $1
|
138
|
+
end
|
134
139
|
attr['sectionFormat'] = 'bare'
|
135
140
|
when /\A<<(.+)\z/
|
136
141
|
href = $1
|
@@ -374,8 +379,20 @@ COLORS
|
|
374
379
|
end
|
375
380
|
end
|
376
381
|
|
382
|
+
SVG_NAMESPACES = {"xmlns"=>"http://www.w3.org/2000/svg",
|
383
|
+
"xlink"=>"http://www.w3.org/1999/xlink"}
|
384
|
+
|
377
385
|
def svg_clean_kgt(s)
|
378
386
|
d = REXML::Document.new(s)
|
387
|
+
REXML::XPath.each(d.root, "/xmlns:svg", SVG_NAMESPACES) do |x|
|
388
|
+
if (w = x.attributes["width"]) && (h = x.attributes["height"])
|
389
|
+
x.attributes["viewBox"] = "0 0 %d %d" % [w, h]
|
390
|
+
end
|
391
|
+
if x.attributes["viewBox"]
|
392
|
+
x.attributes["width"] = nil
|
393
|
+
x.attributes["height"] = nil
|
394
|
+
end
|
395
|
+
end
|
379
396
|
REXML::XPath.each(d.root, "//rect|//line|//path") do |x|
|
380
397
|
x.attributes["fill"] = "none"
|
381
398
|
x.attributes["stroke"] = "black"
|
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.5.
|
4
|
+
version: 1.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carsten Bormann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-07-
|
11
|
+
date: 2021-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: kramdown
|