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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bdccda451ed897f8e9dcdc5b845116287f98bb610694119b6726933b7ed333bc
4
- data.tar.gz: '01086d9d20ea2b65b35a5f73f59eaf05c20a342709e0cb8e8a7fc3c405848f0b'
3
+ metadata.gz: 787fca08ab2b717cbb7dc537088c0e3472da2e932b5949ffca776c9e7d9f11a4
4
+ data.tar.gz: ef1324298dc213f3443e032956d1d22051acca145aa6320e6f48facdcb7a0491
5
5
  SHA512:
6
- metadata.gz: 2b34067b3f5b8959f3df01d930ab18d905b4adbeb054651d1f6b3a4b4e1f995963bc2f5b861c3f638b2f9b63664ea800f1e0f25126daaeefab8d5503baac6e74
7
- data.tar.gz: c50604d92a25d02f0a05024d3e35e79fa4c9e7aacd996270d216dd0ccb3c3a284bffdbfae2334c583f410340ea3cf91b865e74a3dc6d79337f3caf74d863623a
6
+ metadata.gz: 3c385cea8602c6470794c5411217f9fb95ef3d2deefac2eafbf054722e5ea7b9d524334535f8a7c25370704d3bd4e177f5c5ab69c3059158772ea76de99a1549
7
+ data.tar.gz: 91f5aa7f012367a4ea7c1f889955d6be92d91aae0ef96ccfb4e027d765eedf7d09e0e73a421434edac853386042d68cb0e36657cf8d5915d87bfa9083359e9c3
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 8.7.0
2
+
3
+ * Allow data attributes in spans ([#364](https://github.com/alphagov/govspeak/pull/364))
4
+
5
+ ## 8.6.1
6
+
7
+ * Update dependencies
8
+
1
9
  ### 8.6.0
2
10
 
3
11
  * Remove embed functionality ([#358](https://github.com/alphagov/govspeak/pull/358))
@@ -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],
@@ -1,3 +1,3 @@
1
1
  module Govspeak
2
- VERSION = "8.6.0".freeze
2
+ VERSION = "8.7.0".freeze
3
3
  end
@@ -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.6.0
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-10-30 00:00:00.000000000 Z
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.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.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.22
347
+ rubygems_version: 3.5.23
348
348
  signing_key:
349
349
  specification_version: 4
350
350
  summary: Markup language for single domain