svg_conform 0.2.10 → 0.2.11

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: a98a255cfd05daa747f6fb0a57ac7073f08a5a1d4fcf92605f0d07a6bbc15f1d
4
- data.tar.gz: 6090500381531d8dba8d286d331a0db7ae5de241afb9555860926c7ce7bcb735
3
+ metadata.gz: 47a69939791e2184f2a6980bf715203b28f3b97a076190a21fd9adf992cafeb3
4
+ data.tar.gz: 27807b772bc4626044904dedda5a04578dd9679ce00d7b0f8a5431ff609a61b5
5
5
  SHA512:
6
- metadata.gz: 41f637b73125016607e79e0c4196208edde2efa2c54ad498a7fea32837b4b378f40f224582a0302ff9ecb6eee687dfb1b14512201c1b7de62edad0c59d280a09
7
- data.tar.gz: a1c98f687632c433dd2cb3057f65ac8b2336167de6c80675079bde8c436655e66140c663bed81249bb12b4e72aa22459c180a0b762b50c1070c1bcbe89fdd0a0
6
+ metadata.gz: ad73ad2adcd1a625ae283cc207d97600d162e5fb5f6a740ae5b0cf46920a267c185493d6f843ac8fa0e7147ddcb259d740b61d1d5ab5c00f71568ecf1f18a1b2
7
+ data.tar.gz: 454f4e15a95caac88385b5f54f043a73793d21f3a683c92d35846deab26a8968b959f2921356f4564685f1c61a24b9ce9049d1279b682ccb2d16fc099eefcd58
@@ -20,6 +20,7 @@ on:
20
20
  permissions:
21
21
  contents: write
22
22
  id-token: write
23
+ pull-requests: write
23
24
 
24
25
  concurrency:
25
26
  group: release
@@ -28,5 +29,7 @@ concurrency:
28
29
  jobs:
29
30
  release:
30
31
  uses: metanorma/ci/.github/workflows/rubygems-release.yml@main
32
+ secrets:
33
+ pat_token: ${{ secrets.CLARICLE_CI_PAT_TOKEN }}
31
34
  with:
32
35
  next_version: ${{ github.event.inputs.next_version }}
data/Gemfile CHANGED
@@ -11,7 +11,6 @@ gem "lutaml-model", "~> 0.8.155" # rubygems line; drop the git-main float
11
11
  gem "moxml", "~> 0.6.0"
12
12
  # lens_core is optional at runtime (#121); development and CI use the released v1 gem.
13
13
  gem "lens_core", "~> 0.1"
14
- gem "nokogiri", "~> 1.16"
15
14
  gem "openssl", "~> 3.0"
16
15
  gem "rake"
17
16
  gem "rspec"
data/Gemfile.lock CHANGED
@@ -1,11 +1,11 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- svg_conform (0.2.9)
4
+ svg_conform (0.2.11)
5
5
  lens_core (~> 0.1)
6
+ leptris (~> 1.9)
6
7
  lutaml-model (~> 0.8.155)
7
8
  moxml (~> 0.6.0)
8
- nokogiri (~> 1.16)
9
9
  rainbow
10
10
  table_tennis
11
11
  thor
@@ -37,30 +37,30 @@ GEM
37
37
  ffi (1.17.4-x86_64-darwin)
38
38
  ffi (1.17.4-x86_64-linux-gnu)
39
39
  ffi (1.17.4-x86_64-linux-musl)
40
- json (3.1.0)
40
+ json (3.2.0)
41
41
  language_server-protocol (3.17.0.6)
42
42
  lens_core (0.1.0)
43
- leptris (1.9.417.0-aarch64-linux)
43
+ leptris (1.9.448.0-aarch64-linux)
44
44
  ffi (~> 1.15)
45
- leptris (1.9.417.0-aarch64-linux-musl)
45
+ leptris (1.9.448.0-aarch64-linux-musl)
46
46
  ffi (~> 1.15)
47
- leptris (1.9.417.0-arm-linux)
47
+ leptris (1.9.448.0-arm-linux)
48
48
  ffi (~> 1.15)
49
- leptris (1.9.417.0-arm-linux-musl)
49
+ leptris (1.9.448.0-arm-linux-musl)
50
50
  ffi (~> 1.15)
51
- leptris (1.9.417.0-arm64-darwin)
51
+ leptris (1.9.448.0-arm64-darwin)
52
52
  ffi (~> 1.15)
53
- leptris (1.9.417.0-x86_64-darwin)
53
+ leptris (1.9.448.0-x86_64-darwin)
54
54
  ffi (~> 1.15)
55
- leptris (1.9.417.0-x86_64-linux)
55
+ leptris (1.9.448.0-x86_64-linux)
56
56
  ffi (~> 1.15)
57
- leptris (1.9.417.0-x86_64-linux-musl)
57
+ leptris (1.9.448.0-x86_64-linux-musl)
58
58
  ffi (~> 1.15)
59
59
  lint_roller (1.1.0)
60
60
  liquid (5.14.0)
61
61
  bigdecimal
62
62
  strscan (>= 3.1.1)
63
- lutaml-model (0.8.174)
63
+ lutaml-model (0.8.187)
64
64
  base64 (>= 0.1.1)
65
65
  bigdecimal
66
66
  canon
@@ -71,7 +71,7 @@ GEM
71
71
  rubyzip (~> 3.7)
72
72
  thor (~> 1.4)
73
73
  memo_wise (1.13.0)
74
- moxml (0.6.5)
74
+ moxml (0.6.19)
75
75
  nokogiri (1.19.7-aarch64-linux-gnu)
76
76
  racc (~> 1.4)
77
77
  nokogiri (1.19.7-aarch64-linux-musl)
@@ -92,7 +92,7 @@ GEM
92
92
  ostruct (0.6.3)
93
93
  paint (2.3.0)
94
94
  parallel (2.3.0)
95
- parser (3.3.13.0)
95
+ parser (3.3.14.0)
96
96
  ast (~> 2.4.1)
97
97
  racc
98
98
  prism (2.1.0-aarch64-linux-gnu)
@@ -106,7 +106,7 @@ GEM
106
106
  racc (1.8.1)
107
107
  rainbow (3.1.1)
108
108
  rake (13.4.2)
109
- regexp_parser (2.13.1)
109
+ regexp_parser (2.13.4)
110
110
  rspec (3.13.2)
111
111
  rspec-core (~> 3.13.0)
112
112
  rspec-expectations (~> 3.13.0)
@@ -120,7 +120,7 @@ GEM
120
120
  diff-lcs (>= 1.2.0, < 2.0)
121
121
  rspec-support (~> 3.13.0)
122
122
  rspec-support (3.13.8)
123
- rubocop (1.92.2)
123
+ rubocop (1.93.0)
124
124
  json (>= 2.3)
125
125
  language_server-protocol (~> 3.17.0.2)
126
126
  lint_roller (~> 1.1.0)
@@ -128,12 +128,14 @@ GEM
128
128
  parser (>= 3.3.0.2)
129
129
  rainbow (>= 2.2.2, < 4.0)
130
130
  regexp_parser (>= 2.11.3, < 3.0)
131
- rubocop-ast (>= 1.49.0, < 2.0)
131
+ rubocop-ast (>= 1.54.0, < 2.0)
132
132
  ruby-progressbar (~> 1.7)
133
133
  unicode-display_width (>= 2.4.0, < 4.0)
134
- rubocop-ast (1.51.0)
134
+ rubocop-ast (1.54.0)
135
+ ast (~> 2.4)
135
136
  parser (>= 3.3.7.2)
136
137
  prism (>= 1.7)
138
+ racc
137
139
  rubocop-performance (1.27.0)
138
140
  lint_roller (~> 1.1)
139
141
  rubocop (>= 1.89.0, < 2.0)
@@ -161,21 +163,21 @@ GEM
161
163
  unicode-name (1.15.1)
162
164
  unicode-types (~> 1.12)
163
165
  unicode-types (1.12.0)
164
- yeptris (0.6.62.2-aarch64-linux)
166
+ yeptris (0.6.90.0-aarch64-linux)
165
167
  ffi (~> 1.15)
166
- yeptris (0.6.62.2-aarch64-linux-musl)
168
+ yeptris (0.6.90.0-aarch64-linux-musl)
167
169
  ffi (~> 1.15)
168
- yeptris (0.6.62.2-arm-linux-eabihf)
170
+ yeptris (0.6.90.0-arm-linux-eabihf)
169
171
  ffi (~> 1.15)
170
- yeptris (0.6.62.2-arm-linux-musleabihf)
172
+ yeptris (0.6.90.0-arm-linux-musleabihf)
171
173
  ffi (~> 1.15)
172
- yeptris (0.6.62.2-arm64-darwin)
174
+ yeptris (0.6.90.0-arm64-darwin)
173
175
  ffi (~> 1.15)
174
- yeptris (0.6.62.2-x86_64-darwin)
176
+ yeptris (0.6.90.0-x86_64-darwin)
175
177
  ffi (~> 1.15)
176
- yeptris (0.6.62.2-x86_64-linux)
178
+ yeptris (0.6.90.0-x86_64-linux)
177
179
  ffi (~> 1.15)
178
- yeptris (0.6.62.2-x86_64-linux-musl)
180
+ yeptris (0.6.90.0-x86_64-linux-musl)
179
181
  ffi (~> 1.15)
180
182
 
181
183
  PLATFORMS
@@ -198,7 +200,6 @@ DEPENDENCIES
198
200
  leptris (>= 1.9.399.0)
199
201
  lutaml-model (~> 0.8.155)
200
202
  moxml (~> 0.6.0)
201
- nokogiri (~> 1.16)
202
203
  openssl (~> 3.0)
203
204
  rake
204
205
  rspec
@@ -225,22 +226,22 @@ CHECKSUMS
225
226
  ffi (1.17.4-x86_64-darwin) sha256=aa70390523cf3235096cf64962b709b4cfbd5c082a2cb2ae714eb0fe2ccda496
226
227
  ffi (1.17.4-x86_64-linux-gnu) sha256=9d3db14c2eae074b382fa9c083fe95aec6e0a1451da249eab096c34002bc752d
227
228
  ffi (1.17.4-x86_64-linux-musl) sha256=3fdf9888483de005f8ef8d1cf2d3b20d86626af206cbf780f6a6a12439a9c49e
228
- json (3.1.0) sha256=3ce7ccf8fde58960177a3a756c31f292a4c1e1dedee884547096a5b0604e3bd8
229
+ json (3.2.0) sha256=4a4e222a9ee6ffb296ab3171b6b39d85fec83afc4e7b57eee17edf68c74aec87
229
230
  language_server-protocol (3.17.0.6) sha256=5ef2c0c138f8267e1bc631d3328347d354f96724b0af22f2c79516120443b7f0
230
231
  lens_core (0.1.0) sha256=9481ce7721be1b9ddb08e0edde349775849614d40a78ff05ec5887de2aa9e2b6
231
- leptris (1.9.417.0-aarch64-linux) sha256=dba75a31e71573b14f0c9247db99cbc7888c315738c435989aac1352c4a94e56
232
- leptris (1.9.417.0-aarch64-linux-musl) sha256=011a67588f22d397a98d5a52fb32d40cdfd1456caaae68a5b646a11d851c8e44
233
- leptris (1.9.417.0-arm-linux) sha256=6eff14e2d464cc95d7671833b485eaf5ceef45663ef3d7b0024d2c3dca414ca4
234
- leptris (1.9.417.0-arm-linux-musl) sha256=b862cd5cf644f107a536f9c4a72e4346bcf221522c4a54747232155c4aa19862
235
- leptris (1.9.417.0-arm64-darwin) sha256=cb40ee5c4f1b6c507a626e5a1fe35cf81265c470ff48ce7e6cb51336bc3572bc
236
- leptris (1.9.417.0-x86_64-darwin) sha256=f48f3b8ea5e395633cf0925106e1196831a9b8666217d8b1289d7b9b865ddcd1
237
- leptris (1.9.417.0-x86_64-linux) sha256=ea69ee2a4e4b6f22d85d890adf6b03a2e791f7cc7a9f267140c5d12b0c2bfe34
238
- leptris (1.9.417.0-x86_64-linux-musl) sha256=ec4ba05b66afb308a770f842312cd3346b9117be0b0c0812d6be13851a1368a9
232
+ leptris (1.9.448.0-aarch64-linux) sha256=32c532cf2d75ad878264b0798d904efc9fad3f08207afff81c0b60a20f3eb406
233
+ leptris (1.9.448.0-aarch64-linux-musl) sha256=299f42b160c26895af4ab1224d9e517beb9c412a415a1e603d6d51ddf566788f
234
+ leptris (1.9.448.0-arm-linux) sha256=ed709a5cebf5e753b2f273ab243edb0e884a45345d65f0f79a175abdc5740364
235
+ leptris (1.9.448.0-arm-linux-musl) sha256=983aa5501a31a9f2c8e824ce18d9df49713268779bab3b501308ad7d7840b06e
236
+ leptris (1.9.448.0-arm64-darwin) sha256=6f72f4e95de6ad331ea00db6aca57bcb39e0a0b7e43b37322c00ee8ea3df5b9f
237
+ leptris (1.9.448.0-x86_64-darwin) sha256=78e06f1683e61dd785eb5dcbe7b0277d869962c0d3919ab2f5e99e69fa876c40
238
+ leptris (1.9.448.0-x86_64-linux) sha256=726d2f1cc0b2991781463f90edfacc8fb1e75ef12a65fcc6b6e1ea4d0b357ee0
239
+ leptris (1.9.448.0-x86_64-linux-musl) sha256=ada923c0604280cfcc1f22618e0712f73d50cae33ab22eb5d6775c6135e35c48
239
240
  lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87
240
241
  liquid (5.14.0) sha256=e1020c2b2ee58c7a4d3bfdc7a331537bd27a783353748bff0bf27c6ac0c17065
241
- lutaml-model (0.8.174) sha256=d8e92d630a5972fe98bf5fe3f778db47afa328fb36a712c71531e6f82b49d110
242
+ lutaml-model (0.8.187) sha256=a7de4cbd700120f68b6b1cb67cc652da3a1f92d1aa6e80ec959993d3dfb331e8
242
243
  memo_wise (1.13.0) sha256=30220c38c4cef410849bc73553c58664dc2c91c6379e4a1df22aea02358b716b
243
- moxml (0.6.5) sha256=bd2671d47c10f19eae3f5d5750aa419304c51cac5ac3ca906044c149429950f4
244
+ moxml (0.6.19) sha256=8e56fb91627280dc4e1b91d1956062f9e16cee056a23868d7cb069c7283eab20
244
245
  nokogiri (1.19.7-aarch64-linux-gnu) sha256=8f5e15d299602456406e1f03a9f3456cceb33a0722811e818d2ee2214eb4c84a
245
246
  nokogiri (1.19.7-aarch64-linux-musl) sha256=efe0c3602e6e54521bc21c681930ce5568e2d11203de17400710b2b3ca2e4cb4
246
247
  nokogiri (1.19.7-arm-linux-gnu) sha256=7fd1907125691aa89e838cc91161761c758b4e17bb32f0dd9b5515a82cc759af
@@ -253,7 +254,7 @@ CHECKSUMS
253
254
  ostruct (0.6.3) sha256=95a2ed4a4bd1d190784e666b47b2d3f078e4a9efda2fccf18f84ddc6538ed912
254
255
  paint (2.3.0) sha256=327d623e4038619d5bd99ae5db07973859cd78400c7f0329eea283cef8e83be5
255
256
  parallel (2.3.0) sha256=f75a3e904101ce6a1ccb6b8dc800cbafd42166d83330192438dcf29395167a6f
256
- parser (3.3.13.0) sha256=e02f9b63c2fe05b0c68f692ba4df89b3cb113b663964f75d988fbebfd6c3deca
257
+ parser (3.3.14.0) sha256=62f8f76af7b919425ee2d811880e9dcb8011ab40bfd59970dfb583141697e58f
257
258
  prism (2.1.0-aarch64-linux-gnu) sha256=808dddc72def68e1a0463689414c97e0ba211938eddbab05387a4844aa2b3ec2
258
259
  prism (2.1.0-aarch64-linux-musl) sha256=dd1a0732620c1e575dabb07a297a62911fabd72f8e20ce850b522a866f877930
259
260
  prism (2.1.0-arm-linux-gnu) sha256=96b2426b9dbab05448c4add735619929042be3cd7e871ff186468121b62bcfa8
@@ -265,35 +266,35 @@ CHECKSUMS
265
266
  racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
266
267
  rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a
267
268
  rake (13.4.2) sha256=cb825b2bd5f1f8e91ca37bddb4b9aaf345551b4731da62949be002fa89283701
268
- regexp_parser (2.13.1) sha256=5aedb6b7c35688f51e86eef17a15374dfd287c83f4ca644b2c5f3ec50a33b44b
269
+ regexp_parser (2.13.4) sha256=1d0547814f57e6f00946957bd0ca201bc42f42cfb08eee89df60998aedcd8a3b
269
270
  rspec (3.13.2) sha256=206284a08ad798e61f86d7ca3e376718d52c0bc944626b2349266f239f820587
270
271
  rspec-core (3.13.7) sha256=c64ff16d9788119805cbc6a3f4b6d87cc22417c2d25976a3330de136896b5469
271
272
  rspec-expectations (3.13.6) sha256=bf538ca6d367ff5b0d85a87fdb5c0c6038f2cd1308a0eeba07476caa02d22f35
272
273
  rspec-mocks (3.13.9) sha256=ea5c7ff3054a6098ca6039aacef80aec69d5a8a3ef80be8fc88337359b672a30
273
274
  rspec-support (3.13.8) sha256=e4160030309b7e3e9d9863dfe720a35dfcc577162f5402cd68fc8c5258a0ffd6
274
- rubocop (1.92.2) sha256=14fb31eed143a0dc6f78186c550c1715e81cd38f59d05d1165050e445c1f5382
275
- rubocop-ast (1.51.0) sha256=0ec311e36b191b3872d909078a35274e962ae97dbce64be6812d145ca59acfcb
275
+ rubocop (1.93.0) sha256=cb675628d17fe21dfab42f84848040ca2785c22ee4df41c888bfc404f3e74684
276
+ rubocop-ast (1.54.0) sha256=11f7cadec54e593e905b1bb78f2b28bdd4b8e13b34cb82fe49c876e3dd5008c1
276
277
  rubocop-performance (1.27.0) sha256=eeeb1374d062a368ee1c787b70eb0b0cc4b184cb1f8565f424760946146d61ce
277
278
  rubocop-rake (0.7.1) sha256=3797f2b6810c3e9df7376c26d5f44f3475eda59eb1adc38e6f62ecf027cbae4d
278
279
  rubocop-rspec (3.10.2) sha256=0b3e2ecc592cd10ecbf0095bb58d1e357905276e069643523cc19eb7495f65e2
279
280
  ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
280
281
  rubyzip (3.7.0) sha256=65c19294da75297a939006f3516deacc33185fbd721ff1954f7a231db6d3e121
281
282
  strscan (3.1.8) sha256=aae2db611a225559f21ffbb71765c9a4e60fd262534a9ea84f4f11c7f32f679e
282
- svg_conform (0.2.9)
283
+ svg_conform (0.2.11)
283
284
  table_tennis (1.0.0) sha256=955f76ca4debd42ee88682af8d4554a74d533c89de4f1581bc37855b15faa956
284
285
  thor (1.5.0) sha256=e3a9e55fe857e44859ce104a84675ab6e8cd59c650a49106a05f55f136425e73
285
286
  unicode-display_width (3.3.0) sha256=4b7aa66a4b11db50f6f7e98411215cd0dd10eaecb665d36eec5bcacb3fa0b613
286
287
  unicode-emoji (4.3.0) sha256=11c02fa73290378c066bb0562cd4c87d8e1b706fbbe0059ca12746a4244de8ce
287
288
  unicode-name (1.15.1) sha256=b8f2e3ca14bc24799f84a4f74d43a3612d02a051700d88bc6ca8e3bd53cda3f6
288
289
  unicode-types (1.12.0) sha256=7e26a4352cecc2a50325a3793df834b732581ca9f25c5e29f46f3378934363f6
289
- yeptris (0.6.62.2-aarch64-linux) sha256=9dd3bc757f24dad7ca0c939787be1014aa60a06e6457b0eab5688b8b2710631e
290
- yeptris (0.6.62.2-aarch64-linux-musl) sha256=0571ebfe60beefaa43bfbb7761e3116d62f14bc3cfbfe526b64bb06c536cb327
291
- yeptris (0.6.62.2-arm-linux-eabihf) sha256=0390680ed96caa7d86de4adeb8af6f9b519c3bc7f64e32b6ae9bcef1c1a6a36e
292
- yeptris (0.6.62.2-arm-linux-musleabihf) sha256=54f2fe3926320d5f2fdf25d582408f23557cb0b4e5cc537dc70aa1ba6ebfd745
293
- yeptris (0.6.62.2-arm64-darwin) sha256=aaf5669775735ac1e26c55d6087348976534fbccd8b04b4abf7f73016173dc05
294
- yeptris (0.6.62.2-x86_64-darwin) sha256=24fd9cdfb1eed94349f8db421a8563b5f2979d3a48b609959977ec4c8099a0d3
295
- yeptris (0.6.62.2-x86_64-linux) sha256=84ff1b20ce25ae0dd2ec65ea1abc14d881310ab0efef65ddc89e1384cd50a745
296
- yeptris (0.6.62.2-x86_64-linux-musl) sha256=dd093c8ae7699fd3040fb006be34833412a207edf58b4885ec4f1de8eb4b271b
290
+ yeptris (0.6.90.0-aarch64-linux) sha256=6d94937c9d5a877e947bedfe7151065c1d45175dcda24792341b1bd1fb31c5f6
291
+ yeptris (0.6.90.0-aarch64-linux-musl) sha256=17c1632820128fa6cfefe13d91b47592aae77cc9eb15789f4b400ab2ddf08e8e
292
+ yeptris (0.6.90.0-arm-linux-eabihf) sha256=8beada0a2b478e7fefad0f2308f69964d2486a53b783915673ce8f2611d74d71
293
+ yeptris (0.6.90.0-arm-linux-musleabihf) sha256=08da03d6dacd8daa623f13fe42f13fe0d0c19e2f556395c7a23a5b3d2b5b0aac
294
+ yeptris (0.6.90.0-arm64-darwin) sha256=6fb9eeabbd03f6f13e090c14262db2aa1e65859e5ea7a5f9ba579a382f32745e
295
+ yeptris (0.6.90.0-x86_64-darwin) sha256=b9828cb87565b5286cefd97c6670aafb0559533a6f2d10bb631755fcbc571f3a
296
+ yeptris (0.6.90.0-x86_64-linux) sha256=947de6e113dc190d439b3c529c077c487e1a147236b47f1cab906e02ab2b4bd1
297
+ yeptris (0.6.90.0-x86_64-linux-musl) sha256=d62de65276ec813350452fb9331486f765729e9c3aea2ad0f91ac20f6d929a14
297
298
 
298
299
  BUNDLED WITH
299
300
  4.0.24
@@ -277,6 +277,24 @@ remediations:
277
277
  description: "Promote valid style properties to attributes per RFC 7996 Section 2.1"
278
278
  targets: ["style_promotion"]
279
279
 
280
+ # RFC 7996 Section 2.1: enable-background is removed in SVG 1.2 RFC
281
+ # (never rendered); Inkscape-authored documents carry it on the root
282
+ - id: "enable_background_removal"
283
+ type: "DisallowedAttributeRemediation"
284
+ description: "Remove enable-background (removed in SVG 1.2 RFC, never rendered)"
285
+ targets: ["allowed_elements"]
286
+ attributes:
287
+ - "enable-background"
288
+
289
+ # RFC 7996: the Inkscape namespace is not permitted - strip its
290
+ # attributes and declarations from authoring-tool output
291
+ - id: "inkscape_namespace_removal"
292
+ type: "NamespaceAttributeRemediation"
293
+ description: "Strip Inkscape-namespace attributes and declarations"
294
+ targets: ["namespace_validation", "namespace_attributes"]
295
+ disallowed_namespaces:
296
+ - "http://www.inkscape.org/namespaces/inkscape"
297
+
280
298
  # RFC 7996 Section 2.1: ViewBox auto-generation
281
299
  - id: "viewbox_generation"
282
300
  type: "ViewboxRemediation"
@@ -251,12 +251,11 @@ module SvgConform
251
251
 
252
252
  def parse_document
253
253
  begin
254
- # Create a Moxml context and parse the document. The DOM is
255
- # pinned to the Nokogiri adapter: the leptris adapter segfaults
256
- # natively in attribute traversal on path-heavy SVGs
257
- # (leptris#1712), and this gem's remediation passes are exactly
258
- # that workload.
259
- context = Moxml.new(:nokogiri)
254
+ # Create a Moxml context and parse the document. The adapter
255
+ # is leptris (the stack engine); re-verify the attribute-
256
+ # traversal segfault (leptris#1712) on every leptris bump —
257
+ # this gem's remediation passes are exactly that workload.
258
+ context = Moxml.new(:leptris)
260
259
  @moxml_document = context.parse(@content)
261
260
  rescue StandardError => e
262
261
  raise ParseError, "Failed to parse SVG document: #{e.message}"
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "base_remediation"
4
+
5
+ module SvgConform
6
+ module Remediations
7
+ # Removes explicitly disallowed attributes wherever they appear
8
+ # (config: `attributes`, e.g. the removed-in-RFC enable-background
9
+ # property attribute — svg_1_2_rfc's allowed_elements walk flags it
10
+ # :not_allowed on every element carrying it).
11
+ class DisallowedAttributeRemediation < BaseRemediation
12
+ attribute :type, :string, default: -> { "DisallowedAttributeRemediation" }
13
+ attribute :attributes, :string, collection: true, default: -> { [] }
14
+
15
+ yaml do
16
+ map "attributes", to: :attributes
17
+ end
18
+
19
+ def apply(document, _context)
20
+ changes = []
21
+
22
+ document.traverse do |node|
23
+ next unless element?(node)
24
+
25
+ attributes.each do |attr_name|
26
+ next unless has_attribute?(node, attr_name)
27
+
28
+ remove_attribute(node, attr_name)
29
+ changes << {
30
+ type: :attribute_removed,
31
+ description: "Removed disallowed attribute '#{attr_name}'",
32
+ node_name: node.name,
33
+ attribute: attr_name,
34
+ }
35
+ end
36
+ end
37
+
38
+ changes
39
+ end
40
+ end
41
+ end
42
+ end
@@ -53,7 +53,7 @@ module SvgConform
53
53
  if node.respond_to?(:attribute_nodes)
54
54
  # Use attribute_nodes if available (nokogiri-compatible API style)
55
55
  node.attribute_nodes.each do |attr|
56
- namespace_uri = attr.namespace&.href
56
+ namespace_uri = attr.namespace&.uri
57
57
  next unless namespace_uri
58
58
 
59
59
  if namespace_disallowed?(namespace_uri)
@@ -117,19 +117,34 @@ module SvgConform
117
117
  namespaces_to_remove = removed_namespaces.to_a + disallowed_namespaces
118
118
 
119
119
  namespaces_to_remove.uniq.each do |ns_identifier|
120
- # Try to match xmlns:prefix="anything" where prefix matches the identifier
121
- # or xmlns:prefix="identifier" where the URI matches
122
- pattern = /\s+xmlns:#{Regexp.escape(ns_identifier)}="[^"]*"/
123
-
124
- if xml_str.match?(pattern)
125
- xml_str = xml_str.gsub(pattern, "")
126
- changes << {
127
- type: :namespace_removed,
128
- description: "Removed unused namespace declaration 'xmlns:#{ns_identifier}'",
129
- node_name: "svg",
130
- attribute: "xmlns:#{ns_identifier}",
131
- }
120
+ # URI form (the common case): find the prefix the document
121
+ # actually declared for this namespace, then drop that
122
+ # declaration; also covers the default-namespace spelling.
123
+ decl = /\s+xmlns:([A-Za-z_][\w.-]*)="#{Regexp.escape(ns_identifier)}"/
124
+ prefix_form = /\s+xmlns:#{Regexp.escape(ns_identifier)}="[^"]*"/
125
+ default_form = /\s+xmlns="#{Regexp.escape(ns_identifier)}"/
126
+
127
+ removed_name = nil
128
+ if (m = xml_str.match(decl))
129
+ xml_str = xml_str.gsub(decl, "")
130
+ removed_name = "xmlns:#{m[1]}"
131
+ elsif xml_str.match?(default_form)
132
+ xml_str = xml_str.gsub(default_form, "")
133
+ removed_name = "xmlns"
134
+ elsif xml_str.match?(prefix_form)
135
+ # a caller handed the prefix itself
136
+ xml_str = xml_str.gsub(prefix_form, "")
137
+ removed_name = "xmlns:#{ns_identifier}"
132
138
  end
139
+
140
+ next unless removed_name
141
+
142
+ changes << {
143
+ type: :namespace_removed,
144
+ description: "Removed unused namespace declaration '#{removed_name}'",
145
+ node_name: "svg",
146
+ attribute: removed_name,
147
+ }
133
148
  end
134
149
 
135
150
  # Reparse the document to update the internal DOM
@@ -179,13 +194,7 @@ module SvgConform
179
194
 
180
195
  def should_remove_moxml_attribute?(attr, node, removed_namespaces)
181
196
  if attr.respond_to?(:namespace) && attr.namespace
182
- namespace_uri = if attr.namespace.respond_to?(:href)
183
- attr.namespace.href
184
- elsif attr.namespace.respond_to?(:uri)
185
- attr.namespace.uri
186
- else
187
- attr.namespace.to_s
188
- end
197
+ namespace_uri = attr.namespace.uri
189
198
 
190
199
  return false unless namespace_uri && !namespace_uri.empty?
191
200
 
@@ -211,10 +220,7 @@ module SvgConform
211
220
  ns.prefix == prefix
212
221
  end
213
222
  if ns_def
214
- return ns_def.uri if ns_def.respond_to?(:uri)
215
- return ns_def.href if ns_def.respond_to?(:href)
216
-
217
- return ns_def.to_s
223
+ return ns_def.uri
218
224
  end
219
225
  end
220
226
 
@@ -2,6 +2,7 @@
2
2
 
3
3
  require_relative "remediations/base_remediation"
4
4
  require_relative "remediations/color_remediation"
5
+ require_relative "remediations/disallowed_attribute_remediation"
5
6
  require_relative "remediations/font_embedding_remediation"
6
7
  require_relative "remediations/font_remediation"
7
8
  require_relative "remediations/image_embedding_remediation"
@@ -18,6 +19,7 @@ module SvgConform
18
19
  def self.all
19
20
  [
20
21
  ColorRemediation,
22
+ DisallowedAttributeRemediation,
21
23
  FontEmbeddingRemediation,
22
24
  FontRemediation,
23
25
  ImageEmbeddingRemediation,
@@ -111,7 +111,7 @@ module SvgConform
111
111
  def check_attribute_nodes(node, context)
112
112
  node.attribute_nodes.each do |attr|
113
113
  # Check if attribute has a namespace
114
- namespace_uri = attr.namespace&.href
114
+ namespace_uri = attr.namespace&.uri
115
115
  next unless namespace_uri
116
116
 
117
117
  # Determine if this namespace is invalid based on configuration
@@ -164,13 +164,7 @@ module SvgConform
164
164
  def check_moxml_attribute(attr, node, context)
165
165
  # For Moxml attributes, check if they have namespace information
166
166
  if attr.respond_to?(:namespace) && attr.namespace
167
- namespace_uri = if attr.namespace.respond_to?(:href)
168
- attr.namespace.href
169
- elsif attr.namespace.respond_to?(:uri)
170
- attr.namespace.uri
171
- else
172
- attr.namespace.to_s
173
- end
167
+ namespace_uri = attr.namespace.uri
174
168
 
175
169
  # Skip if no namespace URI
176
170
  return unless namespace_uri && !namespace_uri.empty?
@@ -250,10 +244,7 @@ module SvgConform
250
244
  ns.prefix == prefix
251
245
  end
252
246
  if ns_def
253
- return ns_def.uri if ns_def.respond_to?(:uri)
254
- return ns_def.href if ns_def.respond_to?(:href)
255
-
256
- return ns_def.to_s
247
+ return ns_def.uri
257
248
  end
258
249
  end
259
250
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "nokogiri"
3
+ require "moxml"
4
4
  require "strscan"
5
5
  require_relative "base_requirement"
6
6
  require_relative "../validation/svg_1_1_document_conformance"
@@ -77,11 +77,11 @@ module SvgConform
77
77
  def check_root(source, context)
78
78
  root = root_of(source, context)
79
79
  return unless root
80
- return if root.name == "svg" && root.namespace&.href == SVG_NS
80
+ return if root.name == "svg" && root.namespace&.uri == SVG_NS
81
81
 
82
82
  fail_with(context, "document element must be 'svg' in the " \
83
83
  "#{SVG_NS} namespace, found " \
84
- "'#{root.name}' in '#{root.namespace&.href}'")
84
+ "'#{root.name}' in '#{root.namespace&.uri}'")
85
85
  end
86
86
 
87
87
  def check_version(source, context)
@@ -106,10 +106,10 @@ module SvgConform
106
106
 
107
107
  def check_css2(source, context)
108
108
  parsed = parse(source, context)
109
- return unless parsed.is_a?(Nokogiri::XML::Document)
109
+ return unless parsed.is_a?(Moxml::Document)
110
110
 
111
111
  parsed.traverse do |node|
112
- next unless node.element? && node.namespace&.href == SVG_NS
112
+ next unless node.node_type == :element && node.namespace&.uri == SVG_NS
113
113
 
114
114
  check_style_attribute(node, context)
115
115
  check_style_element(node, context)
@@ -118,13 +118,14 @@ module SvgConform
118
118
 
119
119
  def check_xml_stylesheet(source, context)
120
120
  parsed = parse(source, context)
121
- return unless parsed.is_a?(Nokogiri::XML::Document)
121
+ return unless parsed.is_a?(Moxml::Document)
122
122
 
123
123
  parsed.children.each do |node|
124
- next unless node.processing_instruction? && node.name == STYLESHEET_TARGET
124
+ next unless node.node_type == :processing_instruction &&
125
+ node.name == STYLESHEET_TARGET
125
126
 
126
127
  stylesheet_problems(node.content).each do |problem|
127
- fail_with(context, "xml-stylesheet: #{problem}", line: node.line)
128
+ fail_with(context, "xml-stylesheet: #{problem}", line: node.line_number)
128
129
  end
129
130
  end
130
131
  end
@@ -148,7 +149,7 @@ module SvgConform
148
149
  def report_css(result, where, node, context)
149
150
  result.errors.each do |error|
150
151
  fail_with(context, "CSS 2 grammar in #{where}: #{error}",
151
- line: node.line)
152
+ line: node.line_number)
152
153
  end
153
154
  end
154
155
 
@@ -190,16 +191,16 @@ module SvgConform
190
191
  def parse(source, context)
191
192
  state = context.state_for(self)
192
193
  state.parsed ||= begin
193
- doc = Nokogiri::XML::Document.parse(source) { |c| c.strict.nonet }
194
- doc.root ? doc : { error: Nokogiri::XML::SyntaxError.new("document has no root element") }
195
- rescue Nokogiri::XML::SyntaxError => e
194
+ doc = Moxml.parse(source)
195
+ doc.root ? doc : { error: Moxml::ParseError.new("document has no root element") }
196
+ rescue Moxml::ParseError => e
196
197
  { error: e }
197
198
  end
198
199
  end
199
200
 
200
201
  def root_of(source, context)
201
202
  parsed = parse(source, context)
202
- parsed.is_a?(Nokogiri::XML::Document) ? parsed.root : nil
203
+ parsed.is_a?(Moxml::Document) ? parsed.root : nil
203
204
  end
204
205
 
205
206
  def fail_with(context, message, line: nil)
@@ -622,7 +622,7 @@ repair_mode = false, _mixed_mode = false)
622
622
 
623
623
  doc.xpath("//*").each do |element|
624
624
  element.namespace_definitions.each do |ns|
625
- namespaces[ns.prefix || "default"] = ns.href
625
+ namespaces[ns.prefix || "default"] = ns.uri
626
626
  end
627
627
  end
628
628