svg_conform 0.1.0 → 0.1.1
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 +4 -4
- data/.github/workflows/rake.yml +4 -1
- data/.github/workflows/release.yml +6 -2
- data/Gemfile +1 -0
- data/README.adoc +47 -29
- data/config/profiles/metanorma.yml +4 -4
- data/docs/remediation.adoc +541 -542
- data/docs/requirements.adoc +800 -357
- data/lib/svg_conform/remediations/no_external_css_remediation.rb +4 -4
- data/lib/svg_conform/version.rb +1 -1
- data/spec/fixtures/namespace/repair/basic_violations.svg +3 -3
- data/spec/fixtures/namespace_attributes/repair/basic_violations.svg +2 -2
- data/spec/fixtures/no_external_css/repair/basic_violations.svg +2 -2
- data/spec/fixtures/style_promotion/repair/basic_test.svg +2 -2
- data/svg_conform.gemspec +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ccf420a3e00222240dcc3f07c6af8ca2433e1e355fc2d14a3f250c81dc8accf0
|
|
4
|
+
data.tar.gz: 1adfc48ed569e13d1d4f0929e22558bde3abb8239cd19f4f95f7a5e86321db7a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7c71c121b3e79519ab5453152b86a21e2dba29cf4c43a6f62521796b474571ec9808b1b522f606df4c70dd8e3ddc4d02467bf693f2578731b832084dfb70f630
|
|
7
|
+
data.tar.gz: f95e84b684c86fdc2235c39b86283bde8de5aaa565c6a454bb6181cae1549a2ea1d5e5ca20840902bdb3660fe2eaf0c151368a9c329655059343acbe0a9e2801
|
data/.github/workflows/rake.yml
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
# See https://github.com/metanorma/cimas
|
|
3
3
|
name: rake
|
|
4
4
|
|
|
5
|
+
permissions:
|
|
6
|
+
contents: write
|
|
7
|
+
|
|
5
8
|
on:
|
|
6
9
|
push:
|
|
7
10
|
branches: [ master, main ]
|
|
@@ -12,4 +15,4 @@ jobs:
|
|
|
12
15
|
rake:
|
|
13
16
|
uses: metanorma/ci/.github/workflows/generic-rake.yml@main
|
|
14
17
|
secrets:
|
|
15
|
-
pat_token: ${{ secrets.
|
|
18
|
+
pat_token: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
# See https://github.com/metanorma/cimas
|
|
3
3
|
name: release
|
|
4
4
|
|
|
5
|
+
permissions:
|
|
6
|
+
contents: write
|
|
7
|
+
packages: write
|
|
8
|
+
|
|
5
9
|
on:
|
|
6
10
|
workflow_dispatch:
|
|
7
11
|
inputs:
|
|
@@ -19,5 +23,5 @@ jobs:
|
|
|
19
23
|
with:
|
|
20
24
|
next_version: ${{ github.event.inputs.next_version }}
|
|
21
25
|
secrets:
|
|
22
|
-
rubygems-api-key: ${{ secrets.
|
|
23
|
-
pat_token: ${{ secrets.
|
|
26
|
+
rubygems-api-key: ${{ secrets.CLARICLE_CI_RUBYGEMS_API_KEY }}
|
|
27
|
+
pat_token: ${{ secrets.GITHUB_TOKEN }}
|
data/Gemfile
CHANGED
data/README.adoc
CHANGED
|
@@ -370,55 +370,63 @@ There are two main categories of requirements:
|
|
|
370
370
|
|Type |Requirement |Description
|
|
371
371
|
|
|
372
372
|
|Structural
|
|
373
|
-
|
|
373
|
+
|link:docs/requirements.adoc#namespace-requirement[`NamespaceRequirement`]
|
|
374
374
|
|Ensures proper SVG namespace declarations
|
|
375
375
|
|
|
376
376
|
|Structural
|
|
377
|
-
|
|
377
|
+
|link:docs/requirements.adoc#namespace-attributes-requirement[`NamespaceAttributesRequirement`]
|
|
378
378
|
|Validates namespace attributes are from allowed namespaces
|
|
379
379
|
|
|
380
380
|
|Structural
|
|
381
|
-
|
|
381
|
+
|link:docs/requirements.adoc#allowed-elements-requirement[`AllowedElementsRequirement`]
|
|
382
382
|
|Restricts which SVG elements are permitted
|
|
383
383
|
|
|
384
384
|
|Structural
|
|
385
|
-
|
|
385
|
+
|link:docs/requirements.adoc#viewbox-required-requirement[`ViewboxRequiredRequirement`]
|
|
386
386
|
|Requires viewBox attributes on root elements
|
|
387
387
|
|
|
388
388
|
|Logical
|
|
389
|
-
|
|
389
|
+
|link:docs/requirements.adoc#color-restrictions-requirement[`ColorRestrictionsRequirement`]
|
|
390
390
|
|Enforces color usage restrictions (e.g., grayscale only)
|
|
391
391
|
|
|
392
392
|
|Logical
|
|
393
|
-
|
|
393
|
+
|link:docs/requirements.adoc#font-family-requirement[`FontFamilyRequirement`]
|
|
394
394
|
|Controls font family usage and validates font specifications
|
|
395
395
|
|
|
396
396
|
|Logical
|
|
397
|
-
|
|
397
|
+
|link:docs/requirements.adoc#no-external-css-requirement[`NoExternalCssRequirement`]
|
|
398
398
|
|Prevents external CSS references to ensure self-contained documents
|
|
399
399
|
|
|
400
400
|
|Logical
|
|
401
|
-
|
|
401
|
+
|link:docs/requirements.adoc#no-external-fonts-requirement[`NoExternalFontsRequirement`]
|
|
402
|
+
|Validates that no external font references are present
|
|
403
|
+
|
|
404
|
+
|Logical
|
|
405
|
+
|link:docs/requirements.adoc#no-external-images-requirement[`NoExternalImagesRequirement`]
|
|
406
|
+
|Validates that no external image references are present
|
|
407
|
+
|
|
408
|
+
|Logical
|
|
409
|
+
|link:docs/requirements.adoc#forbidden-content-requirement[`ForbiddenContentRequirement`]
|
|
402
410
|
|Prevents inclusion of forbidden elements and attributes
|
|
403
411
|
|
|
404
412
|
|Logical
|
|
405
|
-
|
|
413
|
+
|link:docs/requirements.adoc#id-reference-requirement[`IdReferenceRequirement`]
|
|
406
414
|
|Validates that ID references point to existing elements
|
|
407
415
|
|
|
408
416
|
|Logical
|
|
409
|
-
|
|
417
|
+
|link:docs/requirements.adoc#invalid-id-references-requirement[`InvalidIdReferencesRequirement`]
|
|
410
418
|
|Detects and validates broken ID references in SVG documents
|
|
411
419
|
|
|
412
420
|
|Logical
|
|
413
|
-
|
|
421
|
+
|link:docs/requirements.adoc#link-validation-requirement[`LinkValidationRequirement`]
|
|
414
422
|
|Validates that links use only ASCII characters (IETF requirement)
|
|
415
423
|
|
|
416
424
|
|Logical
|
|
417
|
-
|
|
425
|
+
|link:docs/requirements.adoc#style-requirement[`StyleRequirement`]
|
|
418
426
|
|Comprehensive CSS style validation including syntax and properties
|
|
419
427
|
|
|
420
428
|
|Logical
|
|
421
|
-
|
|
429
|
+
|link:docs/requirements.adoc#style-promotion-requirement[`StylePromotionRequirement`]
|
|
422
430
|
|Detects style properties that should be promoted to SVG attributes
|
|
423
431
|
|===
|
|
424
432
|
|
|
@@ -438,44 +446,54 @@ SVG documents to resolve requirement violations.
|
|
|
438
446
|
|Type |Remediation |Description |Targets
|
|
439
447
|
|
|
440
448
|
|Content Conversion
|
|
441
|
-
|
|
449
|
+
|link:docs/remediation.adoc#color-remediation[`ColorRemediation`]
|
|
442
450
|
|Converts invalid colors to allowed alternatives using threshold-based conversion
|
|
443
|
-
|
|
451
|
+
|link:docs/requirements.adoc#color-restrictions-requirement[`ColorRestrictionsRequirement`]
|
|
444
452
|
|
|
445
453
|
|Content Conversion
|
|
446
|
-
|
|
454
|
+
|link:docs/remediation.adoc#font-remediation[`FontRemediation`]
|
|
447
455
|
|Maps font families to generic alternatives (serif, sans-serif, monospace)
|
|
448
|
-
|
|
456
|
+
|link:docs/requirements.adoc#font-family-requirement[`FontFamilyRequirement`]
|
|
457
|
+
|
|
458
|
+
|Content Conversion
|
|
459
|
+
|link:docs/remediation.adoc#font-embedding-remediation[`FontEmbeddingRemediation`]
|
|
460
|
+
|Converts external font references to embedded data URIs
|
|
461
|
+
|link:docs/requirements.adoc#no-external-fonts-requirement[`NoExternalFontsRequirement`]
|
|
462
|
+
|
|
463
|
+
|Content Conversion
|
|
464
|
+
|link:docs/remediation.adoc#image-embedding-remediation[`ImageEmbeddingRemediation`]
|
|
465
|
+
|Converts external image references to embedded data URIs
|
|
466
|
+
|link:docs/requirements.adoc#no-external-images-requirement[`NoExternalImagesRequirement`]
|
|
449
467
|
|
|
450
468
|
|Element/Attribute Removal
|
|
451
|
-
|
|
469
|
+
|link:docs/remediation.adoc#namespace-remediation[`NamespaceRemediation`]
|
|
452
470
|
|Removes invalid namespace elements and cleans up namespace declarations
|
|
453
|
-
|
|
471
|
+
|link:docs/requirements.adoc#namespace-requirement[`NamespaceRequirement`]
|
|
454
472
|
|
|
455
473
|
|Element/Attribute Removal
|
|
456
|
-
|
|
474
|
+
|link:docs/remediation.adoc#namespace-attribute-remediation[`NamespaceAttributeRemediation`]
|
|
457
475
|
|Removes attributes from disallowed namespaces
|
|
458
|
-
|
|
476
|
+
|link:docs/requirements.adoc#namespace-attributes-requirement[`NamespaceAttributesRequirement`]
|
|
459
477
|
|
|
460
478
|
|Element/Attribute Removal
|
|
461
|
-
|
|
479
|
+
|link:docs/remediation.adoc#no-external-css-remediation[`NoExternalCssRemediation`]
|
|
462
480
|
|Removes external CSS references including @import and external stylesheets
|
|
463
|
-
|
|
481
|
+
|link:docs/requirements.adoc#no-external-css-requirement[`NoExternalCssRequirement`]
|
|
464
482
|
|
|
465
483
|
|Addition
|
|
466
|
-
|
|
484
|
+
|link:docs/remediation.adoc#viewbox-remediation[`ViewboxRemediation`]
|
|
467
485
|
|Adds missing viewBox attributes to root SVG elements
|
|
468
|
-
|
|
486
|
+
|link:docs/requirements.adoc#viewbox-required-requirement[`ViewboxRequiredRequirement`]
|
|
469
487
|
|
|
470
488
|
|Style Processing
|
|
471
|
-
|
|
489
|
+
|link:docs/remediation.adoc#style-promotion-remediation[`StylePromotionRemediation`]
|
|
472
490
|
|Promotes CSS style properties to equivalent SVG attributes
|
|
473
|
-
|
|
491
|
+
|link:docs/requirements.adoc#style-promotion-requirement[`StylePromotionRequirement`]
|
|
474
492
|
|
|
475
493
|
|Reference Fixing
|
|
476
|
-
|
|
494
|
+
|link:docs/remediation.adoc#invalid-id-references-remediation[`InvalidIdReferencesRemediation`]
|
|
477
495
|
|Fixes or removes broken ID references and invalid href attributes
|
|
478
|
-
|
|
496
|
+
|link:docs/requirements.adoc#id-reference-requirement[`IdReferenceRequirement`], `InvalidIdReferencesRequirement`
|
|
479
497
|
|===
|
|
480
498
|
|
|
481
499
|
|
|
@@ -150,12 +150,12 @@ requirements:
|
|
|
150
150
|
type: "IdReferenceRequirement"
|
|
151
151
|
description: "Validates ID references point to existing elements"
|
|
152
152
|
|
|
153
|
-
# Forbidden content - no multimedia,
|
|
153
|
+
# Forbidden content - no multimedia, scripting, etc.
|
|
154
154
|
- id: "forbidden_content"
|
|
155
155
|
type: "ForbiddenContentRequirement"
|
|
156
|
-
description: "Prohibits multimedia,
|
|
157
|
-
forbidden_elements: ["script", "audio", "video", "
|
|
158
|
-
forbidden_attributes: ["onload", "onclick", "
|
|
156
|
+
description: "Prohibits multimedia, scripting content"
|
|
157
|
+
forbidden_elements: ["script", "audio", "video", "set"]
|
|
158
|
+
forbidden_attributes: ["onload", "onclick", "onkeydown", "onkeyup", "onkeypress"]
|
|
159
159
|
|
|
160
160
|
# NEW: No external CSS - reject without remediation
|
|
161
161
|
- id: "no_external_css"
|