metanorma-utils 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 23f7f4f49baca7a94514b1e777c9b5f5e4b2e7338718926c2efb969e5a654dbf
4
- data.tar.gz: f59c03b860494a645f430f0b7c52a01581d78ff44edbcd1c1469bbce9d616161
3
+ metadata.gz: 1a46112cc35941403c557671059d0f31be446e84cf5a91d6fc9cc3e16e6b5b00
4
+ data.tar.gz: 7704505b81224537aabb3679a753a5ee4a5b02832034f7265a467232dbfb26e7
5
5
  SHA512:
6
- metadata.gz: d13842ede73e8ba31e6bd00ce7893a5e52aba0742a984e316ea3f3fc6af7d0c96d79902881aa1bbd9e0429dd32da51f31d66f9e73564d528c6d46796af62cbef
7
- data.tar.gz: 511b8d457ab0e755bfcf1847c3406038ce3de29220ea40dd9b917ca1706a9da896be8c59aa58cb75e7ed98d40b2372772fd329eb35eb203fb305a2c9abe978c1
6
+ metadata.gz: 7be04b8ee6662d7b82f0c6a5d29026a371607ccc1e5259781a66d6bd10980be3a37eab4f5a5d44aaa6c228f6dcb35b1801842c17362d46b9ab501d3e94888363
7
+ data.tar.gz: 912b02b4e6d6b5a2f9b3338b4868f03cfc36c3a96f9d9cb25b7f07a4a02acb5b2d73f857fa19b238a364da8ae1c30d0e37ca609281c69bd14cb9f502b70aa1c5
data/lib/utils/main.rb CHANGED
@@ -97,40 +97,52 @@ module Metanorma
97
97
  end
98
98
 
99
99
  def save_dataimage(uri)
100
- %r{^data:(image|application)/(?<imgtype>[^;]+);base64,(?<imgdata>.+)$} =~ uri
101
- imgtype.sub!(/\+[a-z0-9]+$/, '') # svg+xml
102
- imgtype = 'png' unless /^[a-z0-9]+$/.match imgtype
103
- Tempfile.open(['image', ".#{imgtype}"]) do |f|
104
- f.binmode
105
- f.write(Base64.strict_decode64(imgdata))
106
- f.path
100
+ %r{^data:(image|application)/(?<imgtype>[^;]+);base64,(?<imgdata>.+)$} =~ uri
101
+ imgtype.sub!(/\+[a-z0-9]+$/, '') # svg+xml
102
+ imgtype = 'png' unless /^[a-z0-9]+$/.match imgtype
103
+ Tempfile.open(['image', ".#{imgtype}"]) do |f|
104
+ f.binmode
105
+ f.write(Base64.strict_decode64(imgdata))
106
+ f.path
107
+ end
107
108
  end
108
- end
109
+
110
+ SVG_NS = "http://www.w3.org/2000/svg".freeze
109
111
 
110
112
  def svgmap_rewrite(xmldoc, localdir = "")
111
113
  n = Namespace.new(xmldoc)
112
114
  xmldoc.xpath(n.ns("//svgmap")).each do |s|
113
- next unless i = s.at(n.ns(".//image")) and src = i["src"]
114
- path = /^data:/.match(src) ? save_dataimage(src) : File.file?(src) ? src : localdir + src
115
- File.file?(path) or next
116
- svg = Nokogiri::XML(File.read(path, encoding: "utf-8"))
117
- svgmap_rewrite1(s, svg, path, n)
118
- /^data:/.match(src) and i["src"] = datauri(path)
115
+ next unless svgmap_rewrite0(s, n)
119
116
  next if s.at(n.ns("./target/eref"))
120
117
  s.replace(s.at(n.ns("./figure")))
121
118
  end
122
119
  end
123
120
 
121
+ def svgmap_rewrite0(s, n)
122
+ if i = s.at(n.ns(".//image")) and src = i["src"]
123
+ path = /^data:/.match(src) ? save_dataimage(src) : File.file?(src) ? src : localdir + src
124
+ File.file?(path) or return false
125
+ svgmap_rewrite1(s, Nokogiri::XML(File.read(path, encoding: "utf-8")), path, n)
126
+ /^data:/.match(src) and i["src"] = datauri(path)
127
+ elsif i = s.at(".//m:svg", "m" => SVG_NS)
128
+ svgmap_rewrite1(s, i, nil, n)
129
+ else
130
+ return false
131
+ end
132
+ true
133
+ end
134
+
124
135
  def svgmap_rewrite1(s, svg, path, n)
125
136
  targets = s.xpath(n.ns("./target")).each_with_object({}) do |t, m|
126
- x = t.at(n.ns("./xref")) and m[t["href"]] = "##{x['target']}"
127
- x = t.at(n.ns("./link")) and m[t["href"]] = x['target']
137
+ x = t.at(n.ns("./xref")) and m[File.expand_path(t["href"])] = "##{x['target']}"
138
+ x = t.at(n.ns("./link")) and m[File.expand_path(t["href"])] = x['target']
128
139
  t.remove if t.at(n.ns("./xref | ./link"))
129
140
  end
130
- svg.xpath(".//xmlns:a").each do |a|
131
- x = targets[a["xlink:href"]] and a["xlink:href"] = x
141
+ svg.xpath(".//m:a", "m" => SVG_NS).each do |a|
142
+ a["xlink:href"] and x = targets[File.expand_path(a["xlink:href"])] and a["xlink:href"] = x
143
+ a["href"] and x = targets[File.expand_path(a["href"])] and a["href"] = x
132
144
  end
133
- File.open(path, "w", encoding: "utf-8") { |f| f.write(svg.to_xml) }
145
+ path and File.open(path, "w", encoding: "utf-8") { |f| f.write(svg.to_xml) }
134
146
  end
135
147
 
136
148
  # not currently used
data/lib/utils/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Utils
3
- VERSION = "1.0.5".freeze
3
+ VERSION = "1.0.6".freeze
4
4
  end
5
5
  end
@@ -36,7 +36,7 @@ Gem::Specification.new do |spec|
36
36
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
37
37
  spec.add_development_dependency "guard", "~> 2.14"
38
38
  spec.add_development_dependency "guard-rspec", "~> 4.7"
39
- spec.add_development_dependency "rake", "~> 12.0"
39
+ spec.add_development_dependency "rake", "~> 13.0"
40
40
  spec.add_development_dependency "rspec", "~> 3.6"
41
41
  spec.add_development_dependency "rubocop", "= 0.54.0"
42
42
  spec.add_development_dependency "simplecov", "~> 0.15"
data/spec/utils_spec.rb CHANGED
@@ -104,6 +104,22 @@ RSpec.describe Metanorma::Utils do
104
104
  <figure><image src="action_schemaexpg2.svg" alt="Workmap"/></figure>
105
105
  <target href="href1.htm"><xref target="ref1">Computer</xref></target><target href="mn://basic_attribute_schema"><link target="http://www.example.com">Phone</link></target><target href="mn://support_resource_schema"><eref type="express" bibitemid="express_action_schema" citeas=""><localityStack><locality type="anchor"><referenceFrom>action_schema.basic</referenceFrom></locality></localityStack>Coffee</eref></target></svgmap>
106
106
  <svgmap id="_60dadf08-48d4-4164-845c-b4e293e00abd">
107
+ <figure>
108
+ <svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1' id='Layer_1' x='0px' y='0px' viewBox='0 0 595.28 841.89' style='enable-background:new 0 0 595.28 841.89;' xml:space='preserve'>
109
+ <a href="mn://action_schema" >
110
+ <rect x="123.28" y="273.93" class="st0" width="88.05" height="41.84"/>
111
+ </a>
112
+ <a href="mn://basic_attribute_schema" >
113
+ <rect x="324.69" y="450.52" class="st0" width="132.62" height="40.75"/>
114
+ </a>
115
+ <a xlink:href="mn://support_resource_schema" >
116
+ <rect x="324.69" y="528.36" class="st0" width="148.16" height="40.75"/>
117
+ </a>
118
+ </svg>
119
+ </figure>
120
+ <target href="mn://action_schema"><xref target="ref1">Computer</xref></target><target href="http://www.example.com"><link target="http://www.example.com">Phone</link></target>
121
+ </svgmap>
122
+ <svgmap id="_60dadf08-48d4-4164-845c-b4e293e00abd">
107
123
  <figure>
108
124
 
109
125
  <image src='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI1LjAuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA1OTUuMjggODQxLjg5IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1OTUuMjggODQxLjg5OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0eXBlPSJ0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2M5dTdkRWV2dCs3N2N3dXZ0ZXU3ZDJ1dnV6YjJPUmU3dTk3WnZWN3Y4VWV2QkxHdi80THdIaSsKWkFSc3dBZ2M3N0MyN3ZxYmEvZ3V3TWUyN3g5OTcvWithdjZPM1FDLzVjbzI4QlFzOEFGZmFBZ3YwZ1dmM0FwdjhQMis4R2ZXOENKOAo4QlMvWkJZUDJmcWU4VEsyOFhtZGF5ZGo3aVJmRnZJcG84cUVuZklxdi9JczMvSXUvL0l3SC9PaEVSQUFPdz09IiB0cmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAxIDExNCAyNjMuODg5OCkiPgo8L2ltYWdlPgo8YSB4bGluazpocmVmPSJtbjovL2FjdGlvbl9zY2hlbWEiID4KCTxyZWN0IHg9IjEyMy4yOCIgeT0iMjczLjkzIiBjbGFzcz0ic3QwIiB3aWR0aD0iODguMDUiIGhlaWdodD0iNDEuODQiLz4KPC9hPgo8YSB4bGluazpocmVmPSJtbjovL2Jhc2ljX2F0dHJpYnV0ZV9zY2hlbWEiID4KCTxyZWN0IHg9IjMyNC42OSIgeT0iNDUwLjUyIiBjbGFzcz0ic3QwIiB3aWR0aD0iMTMyLjYyIiBoZWlnaHQ9IjQwLjc1Ii8+CjwvYT4KPGEgeGxpbms6aHJlZj0ibW46Ly9zdXBwb3J0X3Jlc291cmNlX3NjaGVtYSIgPgoJPHJlY3QgeD0iMzI0LjY5IiB5PSI1MjguMzYiIGNsYXNzPSJzdDAiIHdpZHRoPSIxNDguMTYiIGhlaWdodD0iNDAuNzUiLz4KPC9hPgo8L3N2Zz4K' id='__ISO_17301-1_2016' mimetype='image/svg+xml' height='auto' width='auto' alt='Workmap1'/>
@@ -143,6 +159,19 @@ RSpec.describe Metanorma::Utils do
143
159
  <image src='action_schemaexpg2.svg' alt='Workmap'/>
144
160
  </figure>
145
161
  <target href="mn://support_resource_schema"><eref type="express" bibitemid="express_action_schema" citeas=""><localityStack><locality type="anchor"><referenceFrom>action_schema.basic</referenceFrom></locality></localityStack>Coffee</eref></target></svgmap>
162
+ <figure>
163
+ <svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1' id='Layer_1' x='0px' y='0px' viewBox='0 0 595.28 841.89' style='enable-background:new 0 0 595.28 841.89;' xml:space='preserve'>
164
+ <a href='#ref1'>
165
+ <rect x='123.28' y='273.93' class='st0' width='88.05' height='41.84'/>
166
+ </a>
167
+ <a href='mn://basic_attribute_schema'>
168
+ <rect x='324.69' y='450.52' class='st0' width='132.62' height='40.75'/>
169
+ </a>
170
+ <a xlink:href='mn://support_resource_schema'>
171
+ <rect x='324.69' y='528.36' class='st0' width='148.16' height='40.75'/>
172
+ </a>
173
+ </svg>
174
+ </figure>
146
175
  <svgmap id='_60dadf08-48d4-4164-845c-b4e293e00abd'>
147
176
  <figure>
148
177
  </figure>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-10 00:00:00.000000000 Z
11
+ date: 2021-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sterile
@@ -170,14 +170,14 @@ dependencies:
170
170
  requirements:
171
171
  - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: '12.0'
173
+ version: '13.0'
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
- version: '12.0'
180
+ version: '13.0'
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: rspec
183
183
  requirement: !ruby/object:Gem::Requirement