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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aca914cd77e805824fc1d15d642e3f0e453f12e5ffe0ee17f56b0a497b047382
4
- data.tar.gz: df4c1b4c6d73a796183ba2bf8503ff8b7b943025fd61842767250de4107b27be
3
+ metadata.gz: 49968f621678e46d7ecde1451347a63f8a9dd93d0c7dc1f822ee7314f1c7c3fc
4
+ data.tar.gz: d94a74186a8be6c9880c8e15d73b7961df19ab566a55b5a3a643a34aaa1f3c5a
5
5
  SHA512:
6
- metadata.gz: 5219932525720483e742f5c0e0bb90957c1766c9a019c76491b45b05351e3a864be4ff69bebff5ec942dfb39a090c4b0fbf7f6b4b502f4f526105b46b03c00ca
7
- data.tar.gz: eb2d6d95a67cb80ca52ba46eb299d6edb4a11d9e760c09c36377372876b8c99cfcfd36b6e6461a47797d7e15bd85c3ce1f9e00aa8317a1140361cfea7658cfee
6
+ metadata.gz: 424d084703c00e29cad08da0ee6f4568ac6861772eef79fadf26c6f39a4747d6ec192f04abf262d3f26579d4e7fb8493d00c34f9cf01183cabec1b3ccbe1bf4a
7
+ data.tar.gz: f5d6cf7487ce6601bf2cb3198c9d12727d5c4cc0752c5c9b11f6f29a43304874dca36653e047812486888889bc07e0999fad89d3847b0cb1122f0c020f9f33a1
@@ -1,6 +1,6 @@
1
1
  spec = Gem::Specification.new do |s|
2
2
  s.name = 'kramdown-rfc2629'
3
- s.version = '1.5.3'
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.}
@@ -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 /\A(#{XREF_BASE})<(.+)\z/
132
- href = $2
133
- attr['section'] = $1
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.3
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-23 00:00:00.000000000 Z
11
+ date: 2021-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kramdown