govspeak 8.6.0 → 8.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/govspeak/html_sanitizer.rb +1 -0
- data/lib/govspeak/version.rb +1 -1
- data/test/html_sanitizer_test.rb +9 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 787fca08ab2b717cbb7dc537088c0e3472da2e932b5949ffca776c9e7d9f11a4
|
4
|
+
data.tar.gz: ef1324298dc213f3443e032956d1d22051acca145aa6320e6f48facdcb7a0491
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c385cea8602c6470794c5411217f9fb95ef3d2deefac2eafbf054722e5ea7b9d524334535f8a7c25370704d3bd4e177f5c5ab69c3059158772ea76de99a1549
|
7
|
+
data.tar.gz: 91f5aa7f012367a4ea7c1f889955d6be92d91aae0ef96ccfb4e027d765eedf7d09e0e73a421434edac853386042d68cb0e36657cf8d5915d87bfa9083359e9c3
|
data/CHANGELOG.md
CHANGED
@@ -56,6 +56,7 @@ class Govspeak::HtmlSanitizer
|
|
56
56
|
"svg" => %w[xmlns width height viewbox focusable],
|
57
57
|
"path" => %w[fill d],
|
58
58
|
"div" => [:data],
|
59
|
+
"span" => [:data],
|
59
60
|
# The style attributes are permitted here just for the ones Kramdown for table alignment
|
60
61
|
# we replace them in a post processor.
|
61
62
|
"th" => Sanitize::Config::RELAXED[:attributes]["th"] + %w[style],
|
data/lib/govspeak/version.rb
CHANGED
data/test/html_sanitizer_test.rb
CHANGED
@@ -63,6 +63,15 @@ class HtmlSanitizerTest < Minitest::Test
|
|
63
63
|
)
|
64
64
|
end
|
65
65
|
|
66
|
+
test "allow data attributes on spans" do
|
67
|
+
html = "<span data-module='toggle' data-ecommerce-path='/' data-track-category='someSpan'>Test Span</span>"
|
68
|
+
|
69
|
+
assert_equal(
|
70
|
+
"<span data-module=\"toggle\" data-ecommerce-path=\"/\" data-track-category=\"someSpan\">Test Span</span>",
|
71
|
+
Govspeak::HtmlSanitizer.new(html).sanitize,
|
72
|
+
)
|
73
|
+
end
|
74
|
+
|
66
75
|
test "allows images on whitelisted domains" do
|
67
76
|
html = "<img src='http://allowed.com/image.jgp'>"
|
68
77
|
sanitized_html = Govspeak::HtmlSanitizer.new(html, allowed_image_hosts: ["allowed.com"]).sanitize
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: govspeak
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 8.
|
4
|
+
version: 8.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GOV.UK Dev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionview
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '6'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 7.2.
|
22
|
+
version: 7.2.3
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: '6'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 7.2.
|
32
|
+
version: 7.2.3
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: addressable
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -344,7 +344,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
344
344
|
- !ruby/object:Gem::Version
|
345
345
|
version: '0'
|
346
346
|
requirements: []
|
347
|
-
rubygems_version: 3.5.
|
347
|
+
rubygems_version: 3.5.23
|
348
348
|
signing_key:
|
349
349
|
specification_version: 4
|
350
350
|
summary: Markup language for single domain
|