jekyll-antex 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jekyll/antex/block.rb +11 -0
- data/lib/jekyll/antex/version.rb +1 -1
- 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: 2b5addd8c7dd7101a0e9c741f1841a84c7073c742c7b4f2edbb0817b5a38d76b
|
4
|
+
data.tar.gz: bc9649c9722b99f7785a69ca95555be020876ab488c71778b33d15469c2fb3f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9c47f9570936bffe9f87f6fb26c6944b84f9c8edacecc8e8a43b431fc4f42620f318c188c279cb5eace24d71a65a34f302b54bc2ae14d508ce737b2112570ac
|
7
|
+
data.tar.gz: 4718eae474054f548305faa64f60f47b7df9e7b5bff3eaa3097a5f666df6680ee512b5e3acf690a4104cbc75009279e3fd468be3d99344dfc1e475b909a5bb81
|
data/lib/jekyll/antex/block.rb
CHANGED
@@ -67,6 +67,7 @@ module Jekyll
|
|
67
67
|
style = render_style_attribute_value(job.set_box)
|
68
68
|
path = File.read(job.files['svg'])
|
69
69
|
svg = Nokogiri::XML(path).at_css('svg')
|
70
|
+
prefix_svg_symbols_ids(svg, placeholder[HASH_ATTR_NAME])
|
70
71
|
svg.remove_attribute('width')
|
71
72
|
svg.remove_attribute('height')
|
72
73
|
svg.set_attribute('style', style)
|
@@ -74,6 +75,16 @@ module Jekyll
|
|
74
75
|
placeholder.remove()
|
75
76
|
end
|
76
77
|
|
78
|
+
def self.prefix_svg_symbols_ids(doc, pfx)
|
79
|
+
# NOTE: in theory String#insert is destructive but node attribute getter/setters must be doing something weird...
|
80
|
+
doc.css("defs > [id]").each do |node|
|
81
|
+
node[:id] = node[:id].insert(0, pfx + "-")
|
82
|
+
end
|
83
|
+
doc.css("use").each do |node|
|
84
|
+
node[:"xlink:href"] = node[:"xlink:href"].insert(1, pfx + "-")
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
77
88
|
def self.render_placeholder_tag(job)
|
78
89
|
"<object #{HASH_ATTR_NAME}='#{job.hash}'></object>"
|
79
90
|
end
|
data/lib/jekyll/antex/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-antex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paolo Brasolin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-08-
|
11
|
+
date: 2022-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: antex
|