metanorma-standoc 3.5.14 → 3.5.16

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: 3caf54010e6116c8d38d202cf3b9eb00440e094ec25faa04c056ea94f842c3da
4
- data.tar.gz: 28d6080fc9081d4a63d474d0675d26147ed8cb196d16e94f28345301577070f5
3
+ metadata.gz: 5c77b24785b497d4e3ca64e90bcfd3e263c9a74771cc5bfa14c80f14c2fd91a5
4
+ data.tar.gz: 69c6d87c01d208b9cd3cc7ae49242d94f5a40d045924dfcd1e0f56f2b9a839fd
5
5
  SHA512:
6
- metadata.gz: de213d71c0c0043e001ea1ee30f746a028241e2ec4a5cd1288aa99df7e5370bc5d8460cf40b4e1499c2e9f9916660090fc9f36ec848e8859264da0a177fa2fc7
7
- data.tar.gz: b4a4913e12b87b8abff891fb40801a4bd1d1238c6fb2f373d76537f80ca0d5d48e9733a56bd1368d2cda2023b9d0a844ff4f9f6ab8f25fc6a2842ac01a9313d7
6
+ metadata.gz: df70ab7773e92f08efc754ed3c5f52d42ed8fcaffba72195793ded1b4a652df0979dded39a5c57cf7d2540974fa48b1638eabc1544495b8c4ea90531e7780b6d
7
+ data.tar.gz: 71eed247cc0668e5550f3f2613d9391f191f3721e961070bad4cb7287964d2b48696d9918557496dda961c8c329f75745f7ef9e239ff7886d33ec1e286cade69
@@ -34,25 +34,25 @@ requirements:
34
34
  attributes: ["id", "role", "shape-rendering", "text-rendering", "buffered-rendering", "visibility", "base", "lang", "class", "rel", "rev", "typeof", "content", "datatype", "resource", "about", "property", "space", "fill-rule"]
35
35
  allowed_children: ["text"]
36
36
  - tag: "path"
37
- attributes: ["d", "pathLength", "stroke-miterlimit", "id", "role", "fill", "style", "transform", "font-size", "fill-rule", "base", "lang", "class", "rel", "rev", "typeof", "content", "datatype", "resource", "about", "property", "space", "clip-path", "mask"]
37
+ attributes: ["d", "pathLength", "stroke-miterlimit", "id", "role", "fill", "style", "transform", "font-size", "fill-rule", "base", "lang", "class", "rel", "rev", "typeof", "content", "datatype", "resource", "about", "property", "space", "clip-path", "mask", "clip-rule", "opacity"]
38
38
  allowed_children: ["title", "desc"]
39
39
  - tag: "rect"
40
- attributes: ["x", "y", "width", "height", "rx", "ry", "stroke-miterlimit", "id", "role", "fill", "style", "transform", "fill-rule", "base", "lang", "class", "rel", "rev", "typeof", "content", "datatype", "resource", "about", "property", "space", "clip-path", "mask"]
40
+ attributes: ["x", "y", "width", "height", "rx", "ry", "stroke-miterlimit", "id", "role", "fill", "style", "transform", "fill-rule", "base", "lang", "class", "rel", "rev", "typeof", "content", "datatype", "resource", "about", "property", "space", "clip-path", "mask", "clip-rule", "opacity"]
41
41
  allowed_children: ["title", "desc"]
42
42
  - tag: "circle"
43
- attributes: ["cx", "cy", "r", "id", "role", "fill", "style", "transform", "fill-rule", "base", "lang", "class", "rel", "rev", "typeof", "content", "datatype", "resource", "about", "property", "space", "clip-path", "mask"]
43
+ attributes: ["cx", "cy", "r", "id", "role", "fill", "style", "transform", "fill-rule", "base", "lang", "class", "rel", "rev", "typeof", "content", "datatype", "resource", "about", "property", "space", "clip-path", "mask", "clip-rule", "opacity"]
44
44
  allowed_children: ["title", "desc"]
45
45
  - tag: "line"
46
- attributes: ["x1", "y1", "x2", "y2", "id", "role", "fill", "transform", "fill-rule", "base", "lang", "class", "rel", "rev", "typeof", "content", "datatype", "resource", "about", "property", "space", "clip-path", "mask"]
46
+ attributes: ["x1", "y1", "x2", "y2", "id", "role", "fill", "transform", "fill-rule", "base", "lang", "class", "rel", "rev", "typeof", "content", "datatype", "resource", "about", "property", "space", "clip-path", "mask", "clip-rule", "opacity"]
47
47
  allowed_children: ["title", "desc"]
48
48
  - tag: "ellipse"
49
- attributes: ["cx", "cy", "rx", "ry", "id", "role", "fill", "style", "transform", "fill-rule", "base", "lang", "class", "rel", "rev", "typeof", "content", "datatype", "resource", "about", "property", "space", "clip-path", "mask"]
49
+ attributes: ["cx", "cy", "rx", "ry", "id", "role", "fill", "style", "transform", "fill-rule", "base", "lang", "class", "rel", "rev", "typeof", "content", "datatype", "resource", "about", "property", "space", "clip-path", "mask", "clip-rule", "opacity"]
50
50
  allowed_children: ["title", "desc"]
51
51
  - tag: "polyline"
52
- attributes: ["points", "id", "role", "fill", "transform", "fill-rule", "base", "lang", "class", "rel", "rev", "typeof", "content", "datatype", "resource", "about", "property", "space", "clip-path", "mask"]
52
+ attributes: ["points", "id", "role", "fill", "transform", "fill-rule", "base", "lang", "class", "rel", "rev", "typeof", "content", "datatype", "resource", "about", "property", "space", "clip-path", "mask", "clip-rule", "opacity"]
53
53
  allowed_children: ["title", "desc"]
54
54
  - tag: "polygon"
55
- attributes: ["points", "id", "role", "fill", "style", "transform", "fill-rule", "base", "lang", "class", "rel", "rev", "typeof", "content", "datatype", "resource", "about", "property", "space", "clip-path", "mask"]
55
+ attributes: ["points", "id", "role", "fill", "style", "transform", "fill-rule", "base", "lang", "class", "rel", "rev", "typeof", "content", "datatype", "resource", "about", "property", "space", "clip-path", "mask", "clip-rule", "opacity"]
56
56
  allowed_children: ["title", "desc"]
57
57
  - tag: "solidColor"
58
58
  attributes: ["id", "role", "fill", "fill-rule", "base", "lang", "class", "rel", "rev", "typeof", "content", "datatype", "resource", "about", "property", "space", "clip-path", "mask"]
@@ -187,7 +187,9 @@ requirements:
187
187
  check_image_elements: true
188
188
  check_style_images: true
189
189
 
190
- # Text-as-path detection - warns when text is rendered as outlined paths
190
+ # Text-as-path detection: the engine classifies this requirement as a
191
+ # warning by design (vector-traced logos are legitimate input); it is
192
+ # never a corrupt-SVG error.
191
193
  - id: "text_as_path"
192
194
  type: "TextAsPathRequirement"
193
195
  description: "Detects text rendered as outlined paths instead of native <text> elements"
@@ -19,6 +19,6 @@ module Metanorma
19
19
  end
20
20
 
21
21
  module Standoc
22
- VERSION = "3.5.14".freeze
22
+ VERSION = "3.5.16".freeze
23
23
  end
24
24
  end
@@ -1,5 +1,6 @@
1
1
  require "svg_conform"
2
2
  require "png_conform"
3
+ require "yaml"
3
4
  require "metanorma/standoc/conform_profiles"
4
5
 
5
6
  module Metanorma
@@ -91,6 +92,8 @@ module Metanorma
91
92
 
92
93
  def png_validate(doc)
93
94
  return if png_conform_profile == :disabled
95
+ profile = png_conform_engine_profile(png_conform_profile)
96
+ profile.nil? and return
94
97
  doc.xpath("//image[@mimetype = 'image/png'][@src]").each do |i|
95
98
  Vectory::Utils::url?(i["src"]) and next
96
99
  uri = Vectory::Utils::datauri?(i["src"])
@@ -98,13 +101,31 @@ module Metanorma
98
101
  path or next
99
102
  PngConform::Readers::StreamingReader.open(path) do |reader|
100
103
  v = PngConform::Services::ValidationService.new(
101
- reader, path, { profile: @png_conform_profile }
104
+ reader, path, { profile: profile }
102
105
  )
103
106
  png_validate1(i, path, v)
104
107
  end
105
108
  end
106
109
  end
107
110
 
111
+ # png_conform 0.1.6 takes a definition Hash, a built-in/YAML
112
+ # profile name, or nil/"none" (claricle/png_conform#34). Our
113
+ # descriptor is {profile_file:} (an owned YAML file, loaded as an
114
+ # inline definition — the gem reads no consumer directories) or
115
+ # {engine_profile:} (a gem-profile name, resolved loudly there).
116
+ def png_conform_engine_profile(descriptor)
117
+ case descriptor
118
+ when Hash
119
+ if (file = descriptor[:profile_file])
120
+ YAML.safe_load(File.read(file))
121
+ else
122
+ descriptor[:engine_profile]
123
+ end
124
+ else
125
+ descriptor
126
+ end
127
+ end
128
+
108
129
  def png_validate1(img, _path, validator)
109
130
  ret = validator.validate
110
131
  ret.error_messages.each do |e|
@@ -45,7 +45,7 @@ Gem::Specification.new do |spec|
45
45
  spec.add_dependency "moxml", "~> 0.6.1"
46
46
  spec.add_dependency "leptris", "~> 1.9"
47
47
  spec.add_dependency "concurrent-ruby"
48
- spec.add_dependency "png_conform", "~> 0.1.0"
48
+ spec.add_dependency "png_conform", "~> 0.1.7"
49
49
  # svgmap_cleanup reparses vectory's returned document and grafts the
50
50
  # content back (the 0.13 SvgMapping contract: vectory processes its own
51
51
  # tree and returns the result instead of mutating the caller's document).
@@ -53,7 +53,7 @@ Gem::Specification.new do |spec|
53
53
  spec.add_dependency "relaton", "~> 3.1.1"
54
54
  spec.add_dependency "relaton-iev", "~> 2.0"
55
55
  # The profile fixes that accept clip-path/mask on container elements and
56
- # the corrected text-as-path severity live in the 0.2.6 line; the open
56
+ # the corrected text-as-path severity live in the 0.2.7 line; the open
57
57
  # ~> 0.2 floor let bundles keep 0.2.0 and reject valid SVGs
58
58
  # (metanorma-pdfa#106).
59
59
  spec.add_dependency "svg_conform", "~> 0.2.7"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-standoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.14
4
+ version: 3.5.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
@@ -212,14 +212,14 @@ dependencies:
212
212
  requirements:
213
213
  - - "~>"
214
214
  - !ruby/object:Gem::Version
215
- version: 0.1.0
215
+ version: 0.1.7
216
216
  type: :runtime
217
217
  prerelease: false
218
218
  version_requirements: !ruby/object:Gem::Requirement
219
219
  requirements:
220
220
  - - "~>"
221
221
  - !ruby/object:Gem::Version
222
- version: 0.1.0
222
+ version: 0.1.7
223
223
  - !ruby/object:Gem::Dependency
224
224
  name: vectory
225
225
  requirement: !ruby/object:Gem::Requirement