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
|
@@ -75,8 +75,8 @@ module SvgConform
|
|
|
75
75
|
content = node.text || ""
|
|
76
76
|
original_content = content.dup
|
|
77
77
|
|
|
78
|
-
# Remove @import url() statements
|
|
79
|
-
content.gsub!(/@import\s+url\s*\(\s*['"]?([^'")\s]+)['"]?\s*\)\s
|
|
78
|
+
# Remove @import url() statements (including the newline)
|
|
79
|
+
content.gsub!(/@import\s+url\s*\(\s*['"]?([^'")\s]+)['"]?\s*\)\s*;?\s*\n?/i) do |match|
|
|
80
80
|
url = ::Regexp.last_match(1)
|
|
81
81
|
if allowed_url?(url)
|
|
82
82
|
match # Keep allowed URLs
|
|
@@ -95,8 +95,8 @@ module SvgConform
|
|
|
95
95
|
end
|
|
96
96
|
end
|
|
97
97
|
|
|
98
|
-
# Remove @import "url" statements
|
|
99
|
-
content.gsub!(/@import\s+['"]([^'"]+)['"]\s
|
|
98
|
+
# Remove @import "url" statements (including the newline)
|
|
99
|
+
content.gsub!(/@import\s+['"]([^'"]+)['"]\s*;?\s*\n?/i) do |match|
|
|
100
100
|
url = ::Regexp.last_match(1)
|
|
101
101
|
if allowed_url?(url)
|
|
102
102
|
match # Keep allowed URLs
|
data/lib/svg_conform/version.rb
CHANGED
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
version="1.2" baseProfile="tiny" width="100" height="100" viewBox="0 0 100 100">
|
|
4
4
|
<title>Namespace Violations</title>
|
|
5
5
|
|
|
6
|
-
<!-- Invalid namespace elements
|
|
6
|
+
<!-- Invalid namespace elements -->
|
|
7
7
|
|
|
8
|
-
<!-- Invalid namespace attributes
|
|
8
|
+
<!-- Invalid namespace attributes on valid elements -->
|
|
9
9
|
<rect x="10" y="10" width="20" height="20"/>
|
|
10
10
|
<g>
|
|
11
11
|
<circle cx="50" cy="50" r="15"/>
|
|
12
12
|
</g>
|
|
13
13
|
|
|
14
|
-
<!-- Valid namespaces
|
|
14
|
+
<!-- Valid namespaces -->
|
|
15
15
|
<use xlink:href="#test" x="10" y="10"/>
|
|
16
16
|
<text xml:space="preserve" x="10" y="90">Valid</text>
|
|
17
17
|
</svg>
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
version="1.2" baseProfile="tiny" width="100" height="100" viewBox="0 0 100 100">
|
|
4
4
|
<title>Namespace Attributes Test</title>
|
|
5
5
|
|
|
6
|
-
<!-- Invalid namespace attributes
|
|
6
|
+
<!-- Invalid namespace attributes on valid elements -->
|
|
7
7
|
<rect x="10" y="10" width="20" height="20"/>
|
|
8
8
|
<g>
|
|
9
9
|
<circle cx="50" cy="50" r="15"/>
|
|
10
10
|
</g>
|
|
11
11
|
|
|
12
|
-
<!-- Valid namespace attributes
|
|
12
|
+
<!-- Valid namespace attributes -->
|
|
13
13
|
<use xlink:href="#test" x="10" y="10"/>
|
|
14
14
|
<text xml:space="preserve" x="10" y="90">Valid</text>
|
|
15
15
|
</svg>
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
</style>
|
|
11
11
|
</defs>
|
|
12
12
|
|
|
13
|
-
<!-- External stylesheet link
|
|
13
|
+
<!-- External stylesheet link -->
|
|
14
14
|
|
|
15
|
-
<!-- Valid internal styles
|
|
15
|
+
<!-- Valid internal styles -->
|
|
16
16
|
<rect x="10" y="10" width="30" height="30" class="internal"/>
|
|
17
17
|
<circle cx="70" cy="25" r="15" style="fill: white; stroke: black"/>
|
|
18
18
|
</svg>
|
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
<title>Style Promotion</title>
|
|
5
5
|
<desc>Testing style property promotion to attributes</desc>
|
|
6
6
|
|
|
7
|
-
<!-- Style properties
|
|
7
|
+
<!-- Style properties that should be promoted -->
|
|
8
8
|
<rect x="10" y="10" width="30" height="20" fill="black" stroke="none"/>
|
|
9
9
|
<circle cx="60" cy="20" r="10" fill="white" stroke="black" stroke-width="1"/>
|
|
10
10
|
<text x="10" y="50" font-family="serif" font-size="12" fill="black">Text</text>
|
|
11
11
|
<path d="M 10 60 L 40 70 L 10 70 Z" fill="none" stroke="black" stroke-width="2"/>
|
|
12
12
|
|
|
13
|
-
<!--
|
|
13
|
+
<!-- Mixed style and attribute (style should win) -->
|
|
14
14
|
<rect x="80" y="10" width="20" height="20" fill="black"/>
|
|
15
15
|
</svg>
|
data/svg_conform.gemspec
CHANGED
|
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
|
|
|
13
13
|
spec.email = ["open.source@ribose.com"]
|
|
14
14
|
|
|
15
15
|
spec.summary = "SVG profile conformance checker for Ruby."
|
|
16
|
-
spec.homepage = "https://github.com/
|
|
16
|
+
spec.homepage = "https://github.com/claricle/svg_conform"
|
|
17
17
|
spec.license = "BSD-2-Clause"
|
|
18
18
|
spec.required_ruby_version = Gem::Requirement.new(">= 3.1.0")
|
|
19
19
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: svg_conform
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-
|
|
11
|
+
date: 2025-11-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: lutaml-model
|
|
@@ -407,13 +407,13 @@ files:
|
|
|
407
407
|
- spec/svg_conform_spec.rb
|
|
408
408
|
- spec/svgcheck_compatibility_spec.rb
|
|
409
409
|
- svg_conform.gemspec
|
|
410
|
-
homepage: https://github.com/
|
|
410
|
+
homepage: https://github.com/claricle/svg_conform
|
|
411
411
|
licenses:
|
|
412
412
|
- BSD-2-Clause
|
|
413
413
|
metadata:
|
|
414
|
-
homepage_uri: https://github.com/
|
|
415
|
-
source_code_uri: https://github.com/
|
|
416
|
-
bug_tracker_uri: https://github.com/
|
|
414
|
+
homepage_uri: https://github.com/claricle/svg_conform
|
|
415
|
+
source_code_uri: https://github.com/claricle/svg_conform
|
|
416
|
+
bug_tracker_uri: https://github.com/claricle/svg_conform/issues
|
|
417
417
|
post_install_message:
|
|
418
418
|
rdoc_options: []
|
|
419
419
|
require_paths:
|