govspeak 6.7.5 → 6.7.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/govspeak/html_sanitizer.rb +1 -1
- data/lib/govspeak/version.rb +1 -1
- data/lib/govspeak.rb +1 -1
- data/test/govspeak_button_test.rb +8 -8
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 80c02b999651b2cd76424eabedc7619aaf9e494f2049fe16cf4a3ab34869de0f
|
4
|
+
data.tar.gz: adfc46a4aec8dd5c46f54990e392928da7d7610256750a7726b053a679689d90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d04823f5e51d7612529ef89b27a11366c0d8bae6bb3ab0c3d121fbc929e3a3df18dcb3390fbc75f1e706c7e8c3fd742663ffafe74330c5d87e0087370599eb3
|
7
|
+
data.tar.gz: 96f99f887fa623976d28b9cb3e22377650113669635e2f7f77b2bf6eca1f68b3fb43b078ed762c2a4ce0cf44ee7d6f68ad6ea997211b0f39aabfbc1bc43dff93
|
data/CHANGELOG.md
CHANGED
@@ -55,7 +55,7 @@ class Govspeak::HtmlSanitizer
|
|
55
55
|
elements: Sanitize::Config::RELAXED[:elements] + %w[govspeak-embed-attachment govspeak-embed-attachment-link svg path].concat(allowed_elements),
|
56
56
|
attributes: {
|
57
57
|
:all => Sanitize::Config::RELAXED[:attributes][:all] + %w[role aria-label],
|
58
|
-
"a" => Sanitize::Config::RELAXED[:attributes]["a"] + [:data],
|
58
|
+
"a" => Sanitize::Config::RELAXED[:attributes]["a"] + [:data] + %w[draggable],
|
59
59
|
"svg" => Sanitize::Config::RELAXED[:attributes][:all] + %w[xmlns width height viewbox focusable],
|
60
60
|
"path" => Sanitize::Config::RELAXED[:attributes][:all] + %w[fill d],
|
61
61
|
"div" => [:data],
|
data/lib/govspeak/version.rb
CHANGED
data/lib/govspeak.rb
CHANGED
@@ -224,7 +224,7 @@ module Govspeak
|
|
224
224
|
text = text.strip
|
225
225
|
href = href.strip
|
226
226
|
|
227
|
-
%(\n<a role="button" class="#{button_classes}" href="#{href}" #{data_attribute}>#{text}</a>\n)
|
227
|
+
%(\n<a role="button" draggable="false" class="#{button_classes}" href="#{href}" #{data_attribute}>#{text}</a>\n)
|
228
228
|
end
|
229
229
|
|
230
230
|
extension("highlight-answer") do |body|
|
@@ -47,7 +47,7 @@ class GovspeakTest < Minitest::Test
|
|
47
47
|
assert_html_output %(
|
48
48
|
<p>Text before the button with line breaks</p>
|
49
49
|
|
50
|
-
<p><a class="gem-c-button govuk-button" role="button" href="http://www.gov.uk">Start Now</a></p>
|
50
|
+
<p><a class="gem-c-button govuk-button" role="button" draggable="false" href="http://www.gov.uk">Start Now</a></p>
|
51
51
|
|
52
52
|
<p>test after the button</p>
|
53
53
|
)
|
@@ -65,21 +65,21 @@ class GovspeakTest < Minitest::Test
|
|
65
65
|
# Make sure button renders when typical linebreaks are before it, seen in publishing applications
|
66
66
|
test_given_govspeak "{button}[Line breaks](https://gov.uk/random){/button}\r\n\r\n{button}[Continue](https://gov.uk/random){/button}\r\n\r\n{button}[Continue](https://gov.uk/random){/button}" do
|
67
67
|
assert_html_output %(
|
68
|
-
<p><a class="gem-c-button govuk-button" role="button" href="https://gov.uk/random">Line breaks</a></p>
|
68
|
+
<p><a class="gem-c-button govuk-button" role="button" draggable="false" href="https://gov.uk/random">Line breaks</a></p>
|
69
69
|
|
70
|
-
<p><a class="gem-c-button govuk-button" role="button" href="https://gov.uk/random">Continue</a></p>
|
70
|
+
<p><a class="gem-c-button govuk-button" role="button" draggable="false" href="https://gov.uk/random">Continue</a></p>
|
71
71
|
|
72
|
-
<p><a class="gem-c-button govuk-button" role="button" href="https://gov.uk/random">Continue</a></p>
|
72
|
+
<p><a class="gem-c-button govuk-button" role="button" draggable="false" href="https://gov.uk/random">Continue</a></p>
|
73
73
|
)
|
74
74
|
end
|
75
75
|
|
76
76
|
test_given_govspeak "{button}[More line breaks](https://gov.uk/random){/button}\n\n{button}[Continue](https://gov.uk/random){/button}\n\n{button}[Continue](https://gov.uk/random){/button}" do
|
77
77
|
assert_html_output %(
|
78
|
-
<p><a class="gem-c-button govuk-button" role="button" href="https://gov.uk/random">More line breaks</a></p>
|
78
|
+
<p><a class="gem-c-button govuk-button" role="button" draggable="false" href="https://gov.uk/random">More line breaks</a></p>
|
79
79
|
|
80
|
-
<p><a class="gem-c-button govuk-button" role="button" href="https://gov.uk/random">Continue</a></p>
|
80
|
+
<p><a class="gem-c-button govuk-button" role="button" draggable="false" href="https://gov.uk/random">Continue</a></p>
|
81
81
|
|
82
|
-
<p><a class="gem-c-button govuk-button" role="button" href="https://gov.uk/random">Continue</a></p>
|
82
|
+
<p><a class="gem-c-button govuk-button" role="button" draggable="false" href="https://gov.uk/random">Continue</a></p>
|
83
83
|
)
|
84
84
|
end
|
85
85
|
|
@@ -104,7 +104,7 @@ class GovspeakTest < Minitest::Test
|
|
104
104
|
<p>lorem lorem lorem
|
105
105
|
lorem lorem lorem</p>
|
106
106
|
|
107
|
-
<p><a class="gem-c-button govuk-button" role="button" href="https://gov.uk/random">Random page</a></p>
|
107
|
+
<p><a class="gem-c-button govuk-button" role="button" draggable="false" href="https://gov.uk/random">Random page</a></p>
|
108
108
|
|
109
109
|
<p>lorem lorem lorem
|
110
110
|
lorem lorem lorem</p>
|
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: 6.7.
|
4
|
+
version: 6.7.6
|
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: 2021-11-
|
11
|
+
date: 2021-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionview
|
@@ -196,14 +196,14 @@ dependencies:
|
|
196
196
|
requirements:
|
197
197
|
- - "~>"
|
198
198
|
- !ruby/object:Gem::Version
|
199
|
-
version: 4.
|
199
|
+
version: 4.2.0
|
200
200
|
type: :development
|
201
201
|
prerelease: false
|
202
202
|
version_requirements: !ruby/object:Gem::Requirement
|
203
203
|
requirements:
|
204
204
|
- - "~>"
|
205
205
|
- !ruby/object:Gem::Version
|
206
|
-
version: 4.
|
206
|
+
version: 4.2.0
|
207
207
|
- !ruby/object:Gem::Dependency
|
208
208
|
name: simplecov
|
209
209
|
requirement: !ruby/object:Gem::Requirement
|