govspeak 8.7.0 → 8.8.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 787fca08ab2b717cbb7dc537088c0e3472da2e932b5949ffca776c9e7d9f11a4
4
- data.tar.gz: ef1324298dc213f3443e032956d1d22051acca145aa6320e6f48facdcb7a0491
3
+ metadata.gz: e2327c692182754ebd2530797871493caa9ca60f054c612c36eb5f097b89258f
4
+ data.tar.gz: 61d89f0435b46fbfe3db338c1c09e05ec8b28aa9fbf44a33b0e868ed0bb71994
5
5
  SHA512:
6
- metadata.gz: 3c385cea8602c6470794c5411217f9fb95ef3d2deefac2eafbf054722e5ea7b9d524334535f8a7c25370704d3bd4e177f5c5ab69c3059158772ea76de99a1549
7
- data.tar.gz: 91f5aa7f012367a4ea7c1f889955d6be92d91aae0ef96ccfb4e027d765eedf7d09e0e73a421434edac853386042d68cb0e36657cf8d5915d87bfa9083359e9c3
6
+ metadata.gz: 0e3e3cbc55a0a3fc85402199460939470b85f5aff55bb57e8d13342de905c1c3d57ec52199799482c2b731388055a1bd8ac99e27ccfc6846f486da6587c6f09c
7
+ data.tar.gz: ef269168107be73aee3f0f76aa70fb442944593ff5b10d3cc0d5146148bd2968d1a5da3f2e23fde3157a73774adfc3a21271e6e94137e082a6fecf75dc81da83
data/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ # Changelog
2
+
3
+ ## 8.8.0
4
+
5
+ * Strip trailing backslashes from the lines of an address ([#371](https://github.com/alphagov/govspeak/pull/371))
6
+ * When replacing line breaks with "<br>"s in the parsing of address blocks,
7
+ replace the whole "\r\n" line break and not just the "\n" character ([#371](https://github.com/alphagov/govspeak/pull/371))
8
+ * Only strip a leading line break from an address block, not just any old first
9
+ occurrence of a line break ([#371](https://github.com/alphagov/govspeak/pull/371))
10
+ * Strip trailing whitespace from the lines of an address ([#371](https://github.com/alphagov/govspeak/pull/371))
11
+
1
12
  ## 8.7.0
2
13
 
3
14
  * Allow data attributes in spans ([#364](https://github.com/alphagov/govspeak/pull/364))
@@ -6,20 +17,21 @@
6
17
 
7
18
  * Update dependencies
8
19
 
9
- ### 8.6.0
20
+ ## 8.6.0
10
21
 
11
22
  * Remove embed functionality ([#358](https://github.com/alphagov/govspeak/pull/358))
12
23
 
13
- ### 8.5.1
24
+ ## 8.5.1
14
25
 
15
26
  * Rename embed-related code to `content block`
16
27
  * Do not attempt to parse embed codes if `content_blocks` option is missing
17
28
 
18
- ### 8.5.0
29
+ ## 8.5.0
19
30
 
20
31
  * Support embeds in Govspeak
21
32
 
22
33
  ## 8.4.1
34
+
23
35
  * Do not pin version of govuk_publishing_components
24
36
 
25
37
  ## 8.4.0
@@ -201,7 +213,7 @@
201
213
  * Move from govuk-lint to rubocop-govuk
202
214
  * Allow version 6 of actionview
203
215
 
204
- ## 6.5.0
216
+ ## 6.5.0
205
217
 
206
218
  * Allow data attributes on links
207
219
 
@@ -391,7 +403,8 @@
391
403
  * Add an `allowed_image_hosts` options to `HtmlValidator` (and `HtmlSanitizer`)
392
404
  * BREAKING CHANGE: Added the `$EndLegislativeList` tag which allows line breaks in `LegislativeLists`.
393
405
 
394
- ## 2.0.2
406
+ ## 2.0.2
407
+
395
408
  * Fix a bug with the HtmlValidator to do with kramdown now respecting character
396
409
  encodings of input data.
397
410
 
@@ -44,9 +44,6 @@ module Govspeak
44
44
  structured_headers
45
45
  end
46
46
 
47
- attr_reader :doc, :stack, :structured_headers
48
- private :doc, :stack, :structured_headers
49
-
50
47
  def headers_list
51
48
  @headers_list ||= doc.headers.map do |h|
52
49
  StructuredHeader.new(h.text, h.level, h.id, [])
@@ -98,5 +95,9 @@ module Govspeak
98
95
  def reset_stack
99
96
  @stack = []
100
97
  end
98
+
99
+ private
100
+
101
+ attr_reader :doc, :stack, :structured_headers
101
102
  end
102
103
  end
@@ -1,3 +1,3 @@
1
1
  module Govspeak
2
- VERSION = "8.7.0".freeze
2
+ VERSION = "8.8.0".freeze
3
3
  end
data/lib/govspeak.rb CHANGED
@@ -302,7 +302,12 @@ module Govspeak
302
302
  end
303
303
 
304
304
  extension("address", surrounded_by("$A")) do |body|
305
- %(\n<div class="address"><div class="adr org fn"><p markdown="1">\n#{body.sub("\n", '').gsub("\n", '<br />')}\n</p></div></div>\n)
305
+ <<~BODY
306
+
307
+ <div class="address"><div class="adr org fn"><p markdown="1">
308
+ #{body.lstrip.sub(/[\s\\]*\z/, '').gsub(/[ \\]*\r?\n/, '<br />')}
309
+ </p></div></div>
310
+ BODY
306
311
  end
307
312
 
308
313
  extension("legislative list", /#{NEW_PARAGRAPH_LOOKBEHIND}\$LegislativeList\s*$(.*?)\$EndLegislativeList/m) do |body|
@@ -20,23 +20,23 @@ class GovspeakFootnoteTest < Minitest::Test
20
20
  [^3]: And then they both point here." do
21
21
  assert_html_output(
22
22
  %(
23
- <p>Footnotes can be added<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">[footnote 1]</a></sup>.</p>
23
+ <p>Footnotes can be added<sup id="fnref:1"><a href="#fn:1" class="footnote" rel="footnote" role="doc-noteref">[footnote 1]</a></sup>.</p>
24
24
 
25
- <p>Footnotes can be added too<sup id="fnref:2" role="doc-noteref"><a href="#fn:2" class="footnote" rel="footnote">[footnote 2]</a></sup>.</p>
25
+ <p>Footnotes can be added too<sup id="fnref:2"><a href="#fn:2" class="footnote" rel="footnote" role="doc-noteref">[footnote 2]</a></sup>.</p>
26
26
 
27
- <p>This footnote has a reference number<sup id="fnref:3" role="doc-noteref"><a href="#fn:3" class="footnote" rel="footnote">[footnote 3]</a></sup>.</p>
27
+ <p>This footnote has a reference number<sup id="fnref:3"><a href="#fn:3" class="footnote" rel="footnote" role="doc-noteref">[footnote 3]</a></sup>.</p>
28
28
 
29
- <p>And this footnote has the same reference number<sup id="fnref:3:1" role="doc-noteref"><a href="#fn:3" class="footnote" rel="footnote">[footnote 3]</a></sup>.</p>
29
+ <p>And this footnote has the same reference number<sup id="fnref:3:1"><a href="#fn:3" class="footnote" rel="footnote" role="doc-noteref">[footnote 3]</a></sup>.</p>
30
30
 
31
31
  <div class="footnotes" role="doc-endnotes">
32
32
  <ol>
33
- <li id="fn:1" role="doc-endnote">
33
+ <li id="fn:1">
34
34
  <p>And then later defined. <a href="#fnref:1" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
35
35
  </li>
36
- <li id="fn:2" role="doc-endnote">
36
+ <li id="fn:2">
37
37
  <p>And then later defined too. <a href="#fnref:2" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
38
38
  </li>
39
- <li id="fn:3" role="doc-endnote">
39
+ <li id="fn:3">
40
40
  <p>And then they both point here. <a href="#fnref:3" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a> <a href="#fnref:3:1" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced 2">↩<sup>2</sup></a></p>
41
41
  </li>
42
42
  </ol>
@@ -106,7 +106,40 @@ Testcase Cliffs
106
106
  Teston
107
107
  0123 456 7890 $A )
108
108
  doc = Govspeak::Document.new(input)
109
- assert_equal %(\n<div class="address"><div class="adr org fn"><p>\n123 Test Street<br>Testcase Cliffs<br>Teston<br>0123 456 7890 \n</p></div></div>\n), doc.to_html
109
+ assert_equal %(\n<div class="address"><div class="adr org fn"><p>\n123 Test Street<br>Testcase Cliffs<br>Teston<br>0123 456 7890\n</p></div></div>\n), doc.to_html
110
+ end
111
+
112
+ test "newlines in address block content are replaced with <br>s" do
113
+ input = %($A\n123 Test Street\nTestcase Cliffs\nTeston\n0123 456 7890\n$A)
114
+ doc = Govspeak::Document.new(input)
115
+ assert_equal %(\n<div class="address"><div class="adr org fn"><p>\n123 Test Street<br>Testcase Cliffs<br>Teston<br>0123 456 7890\n</p></div></div>\n), doc.to_html
116
+ end
117
+
118
+ test "combined return-and-newlines in address block content are replaced with <br>s" do
119
+ input = %($A\r\n123 Test Street\r\nTestcase Cliffs\r\nTeston\r\n0123 456 7890\r\n$A)
120
+ doc = Govspeak::Document.new(input)
121
+ assert_equal %(\n<div class="address"><div class="adr org fn"><p>\n123 Test Street<br>Testcase Cliffs<br>Teston<br>0123 456 7890\n</p></div></div>\n), doc.to_html
122
+ end
123
+
124
+ test "trailing backslashes are stripped from address block content" do
125
+ # two trailing backslashes would normally be converted into a line break by Kramdown
126
+ input = %($A\r\n123 Test Street\\\r\nTestcase Cliffs\\\nTeston\\\\\r\n0123 456 7890\\\\\n$A)
127
+ doc = Govspeak::Document.new(input)
128
+ assert_equal %(\n<div class="address"><div class="adr org fn"><p>\n123 Test Street<br>Testcase Cliffs<br>Teston<br>0123 456 7890\n</p></div></div>\n), doc.to_html
129
+ end
130
+
131
+ test "trailing spaces are stripped from address block content" do
132
+ # two trailing spaces would normally be converted into a line break by Kramdown
133
+ input = %($A\r\n123 Test Street \r\nTestcase Cliffs \nTeston \r\n0123 456 7890 \n$A)
134
+ doc = Govspeak::Document.new(input)
135
+ assert_equal %(\n<div class="address"><div class="adr org fn"><p>\n123 Test Street<br>Testcase Cliffs<br>Teston<br>0123 456 7890\n</p></div></div>\n), doc.to_html
136
+ end
137
+
138
+ test "trailing backslashes and spaces are stripped from address block content" do
139
+ # two trailing backslashes or two trailing spaces would normally be converted into a line break by Kramdown
140
+ input = %($A\r\n123 Test Street \\\r\nTestcase Cliffs\\ \nTeston\\\\ \r\n0123 456 7890 \\\\\n$A)
141
+ doc = Govspeak::Document.new(input)
142
+ assert_equal %(\n<div class="address"><div class="adr org fn"><p>\n123 Test Street<br>Testcase Cliffs<br>Teston<br>0123 456 7890\n</p></div></div>\n), doc.to_html
110
143
  end
111
144
 
112
145
  test "should convert barchart" do
@@ -141,7 +174,7 @@ Testcase Cliffs
141
174
  Teston
142
175
  0123 456 7890 $A)
143
176
  doc = Govspeak::Document.new(input)
144
- assert_equal %(<p>Paragraph1</p>\n\n<div class="address"><div class="adr org fn"><p>\n123 Test Street<br>Testcase Cliffs<br>Teston<br>0123 456 7890 \n</p></div></div>\n), doc.to_html
177
+ assert_equal %(<p>Paragraph1</p>\n\n<div class="address"><div class="adr org fn"><p>\n123 Test Street<br>Testcase Cliffs<br>Teston<br>0123 456 7890\n</p></div></div>\n), doc.to_html
145
178
  end
146
179
 
147
180
  test_given_govspeak("^ I am very informational ^") do
@@ -388,7 +421,7 @@ Teston
388
421
  $A" do
389
422
  assert_html_output %(
390
423
  <div class="address"><div class="adr org fn"><p>
391
- street<br>road<br>
424
+ street<br>road
392
425
  </p></div></div>)
393
426
  assert_text_output "street road"
394
427
  end
@@ -402,7 +435,7 @@ Teston
402
435
  *[ACRONYM]: This is the acronym explanation" do
403
436
  assert_html_output %(
404
437
  <div class="address"><div class="adr org fn"><p>
405
- street with <abbr title="This is the acronym explanation">ACRONYM</abbr><br>road<br>
438
+ street with <abbr title="This is the acronym explanation">ACRONYM</abbr><br>road
406
439
  </p></div></div>)
407
440
  end
408
441
 
@@ -649,11 +682,11 @@ Teston
649
682
  " do
650
683
  assert_html_output %(
651
684
  <div class="call-to-action">
652
- <p>Click here to start the tool<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">[footnote 1]</a></sup></p>
685
+ <p>Click here to start the tool<sup id="fnref:1"><a href="#fn:1" class="footnote" rel="footnote" role="doc-noteref">[footnote 1]</a></sup></p>
653
686
  </div>
654
687
  <div class="footnotes" role="doc-endnotes">
655
688
  <ol>
656
- <li id="fn:1" role="doc-endnote">
689
+ <li id="fn:1">
657
690
  <p>Footnote definition one <a href="#fnref:1" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
658
691
  </li>
659
692
  </ol>
@@ -676,18 +709,18 @@ Teston
676
709
  assert_html_output %(
677
710
  <div class="call-to-action">
678
711
  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.
679
- Fusce felis ante<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">[footnote 1]</a></sup>, lobortis non quam sit amet, tempus interdum justo.</p>
712
+ Fusce felis ante<sup id="fnref:1"><a href="#fn:1" class="footnote" rel="footnote" role="doc-noteref">[footnote 1]</a></sup>, lobortis non quam sit amet, tempus interdum justo.</p>
680
713
  </div>
681
714
  <div class="call-to-action">
682
- <p>Pellentesque quam enim, egestas sit amet congue sit amet<sup id="fnref:2" role="doc-noteref"><a href="#fn:2" class="footnote" rel="footnote">[footnote 2]</a></sup>, ultrices vitae arcu.
715
+ <p>Pellentesque quam enim, egestas sit amet congue sit amet<sup id="fnref:2"><a href="#fn:2" class="footnote" rel="footnote" role="doc-noteref">[footnote 2]</a></sup>, ultrices vitae arcu.
683
716
  Fringilla, metus dui scelerisque est.</p>
684
717
  </div>
685
718
  <div class="footnotes" role="doc-endnotes">
686
719
  <ol>
687
- <li id="fn:1" role="doc-endnote">
720
+ <li id="fn:1">
688
721
  <p>Footnote definition one <a href="#fnref:1" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
689
722
  </li>
690
- <li id="fn:2" role="doc-endnote">
723
+ <li id="fn:2">
691
724
  <p>Footnote definition two <a href="#fnref:2" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
692
725
  </li>
693
726
  </ol>
@@ -707,17 +740,17 @@ Teston
707
740
  " do
708
741
  assert_html_output %(
709
742
  <div class="call-to-action">
710
- <p>Click here to start the tool<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">[footnote 1]</a></sup></p>
743
+ <p>Click here to start the tool<sup id="fnref:1"><a href="#fn:1" class="footnote" rel="footnote" role="doc-noteref">[footnote 1]</a></sup></p>
711
744
  </div>
712
745
 
713
- <p>Lorem ipsum dolor sit amet<sup id="fnref:2" role="doc-noteref"><a href="#fn:2" class="footnote" rel="footnote">[footnote 2]</a></sup></p>
746
+ <p>Lorem ipsum dolor sit amet<sup id="fnref:2"><a href="#fn:2" class="footnote" rel="footnote" role="doc-noteref">[footnote 2]</a></sup></p>
714
747
 
715
748
  <div class="footnotes" role="doc-endnotes">
716
749
  <ol>
717
- <li id="fn:1" role="doc-endnote">
750
+ <li id="fn:1">
718
751
  <p>Footnote definition 1 <a href="#fnref:1" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
719
752
  </li>
720
- <li id="fn:2" role="doc-endnote">
753
+ <li id="fn:2">
721
754
  <p>Footnote definition 2 <a href="#fnref:2" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
722
755
  </li>
723
756
  </ol>
@@ -783,12 +816,12 @@ Teston
783
816
  " do
784
817
  assert_html_output %(
785
818
  <div class="call-to-action">
786
- <p>Welcome to the <abbr title="The official UK government website">GOV.UK</abbr><sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">[footnote 1]</a></sup></p>
819
+ <p>Welcome to the <abbr title="The official UK government website">GOV.UK</abbr><sup id="fnref:1"><a href="#fn:1" class="footnote" rel="footnote" role="doc-noteref">[footnote 1]</a></sup></p>
787
820
  </div>
788
821
 
789
822
  <div class="footnotes" role="doc-endnotes">
790
823
  <ol>
791
- <li id="fn:1" role="doc-endnote">
824
+ <li id="fn:1">
792
825
  <p><abbr title="The official UK government website">GOV.UK</abbr> is the official UK government <abbr title="A collection of web pages, such as GOV.UK">website</abbr> <a href="#fnref:1" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
793
826
  </li>
794
827
  </ol>
@@ -949,9 +982,9 @@ Teston
949
982
  assert_html_output %(
950
983
  <div class="legislative-list-wrapper">
951
984
  <ol class="legislative-list">
952
- <li>1. Item 1<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">[footnote 1]</a></sup>
985
+ <li>1. Item 1<sup id="fnref:1"><a href="#fn:1" class="footnote" rel="footnote" role="doc-noteref">[footnote 1]</a></sup>
953
986
  </li>
954
- <li>2. Item 2<sup id="fnref:2" role="doc-noteref"><a href="#fn:2" class="footnote" rel="footnote">[footnote 2]</a></sup>
987
+ <li>2. Item 2<sup id="fnref:2"><a href="#fn:2" class="footnote" rel="footnote" role="doc-noteref">[footnote 2]</a></sup>
955
988
  </li>
956
989
  <li>3. Item 3</li>
957
990
  </ol>
@@ -959,10 +992,10 @@ Teston
959
992
 
960
993
  <div class="footnotes" role="doc-endnotes">
961
994
  <ol>
962
- <li id="fn:1" role="doc-endnote">
995
+ <li id="fn:1">
963
996
  <p>Footnote definition one <a href="#fnref:1" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
964
997
  </li>
965
- <li id="fn:2" role="doc-endnote">
998
+ <li id="fn:2">
966
999
  <p>Footnote definition two <a href="#fnref:2" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
967
1000
  </li>
968
1001
  </ol>
@@ -992,19 +1025,19 @@ Teston
992
1025
  assert_html_output %(
993
1026
  <div class="legislative-list-wrapper">
994
1027
  <ol class="legislative-list">
995
- <li>1. Item 1<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">[footnote 1]</a></sup>
1028
+ <li>1. Item 1<sup id="fnref:1"><a href="#fn:1" class="footnote" rel="footnote" role="doc-noteref">[footnote 1]</a></sup>
996
1029
  </li>
997
1030
  <li>2. Item 2</li>
998
1031
  <li>3. Item 3</li>
999
1032
  </ol>
1000
1033
  </div>
1001
1034
 
1002
- <p>This is a paragraph with a footnote<sup id="fnref:2" role="doc-noteref"><a href="#fn:2" class="footnote" rel="footnote">[footnote 2]</a></sup>.</p>
1035
+ <p>This is a paragraph with a footnote<sup id="fnref:2"><a href="#fn:2" class="footnote" rel="footnote" role="doc-noteref">[footnote 2]</a></sup>.</p>
1003
1036
 
1004
1037
  <div class="legislative-list-wrapper">
1005
1038
  <ol class="legislative-list">
1006
1039
  <li>1. Item 1</li>
1007
- <li>2. Item 2<sup id="fnref:3" role="doc-noteref"><a href="#fn:3" class="footnote" rel="footnote">[footnote 3]</a></sup>
1040
+ <li>2. Item 2<sup id="fnref:3"><a href="#fn:3" class="footnote" rel="footnote" role="doc-noteref">[footnote 3]</a></sup>
1008
1041
  </li>
1009
1042
  <li>3. Item 3</li>
1010
1043
  </ol>
@@ -1012,13 +1045,13 @@ Teston
1012
1045
 
1013
1046
  <div class="footnotes" role="doc-endnotes">
1014
1047
  <ol>
1015
- <li id="fn:1" role="doc-endnote">
1048
+ <li id="fn:1">
1016
1049
  <p>Footnote definition one <a href="#fnref:1" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
1017
1050
  </li>
1018
- <li id="fn:2" role="doc-endnote">
1051
+ <li id="fn:2">
1019
1052
  <p>Footnote definition two <a href="#fnref:2" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
1020
1053
  </li>
1021
- <li id="fn:3" role="doc-endnote">
1054
+ <li id="fn:3">
1022
1055
  <p>Footnote definition two <a href="#fnref:3" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
1023
1056
  </li>
1024
1057
  </ol>
@@ -1067,79 +1100,79 @@ Teston
1067
1100
  assert_html_output %(
1068
1101
  <div class="legislative-list-wrapper">
1069
1102
  <ol class="legislative-list">
1070
- <li>1. Item 1<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">[footnote 1]</a></sup>
1103
+ <li>1. Item 1<sup id="fnref:1"><a href="#fn:1" class="footnote" rel="footnote" role="doc-noteref">[footnote 1]</a></sup>
1071
1104
  </li>
1072
- <li>2. Item 2<sup id="fnref:2" role="doc-noteref"><a href="#fn:2" class="footnote" rel="footnote">[footnote 2]</a></sup>
1105
+ <li>2. Item 2<sup id="fnref:2"><a href="#fn:2" class="footnote" rel="footnote" role="doc-noteref">[footnote 2]</a></sup>
1073
1106
  </li>
1074
- <li>3. Item 3<sup id="fnref:3" role="doc-noteref"><a href="#fn:3" class="footnote" rel="footnote">[footnote 3]</a></sup>
1107
+ <li>3. Item 3<sup id="fnref:3"><a href="#fn:3" class="footnote" rel="footnote" role="doc-noteref">[footnote 3]</a></sup>
1075
1108
  </li>
1076
1109
  </ol>
1077
1110
  </div>
1078
1111
 
1079
- <p>This is a paragraph with a footnote<sup id="fnref:4" role="doc-noteref"><a href="#fn:4" class="footnote" rel="footnote">[footnote 4]</a></sup>.</p>
1112
+ <p>This is a paragraph with a footnote<sup id="fnref:4"><a href="#fn:4" class="footnote" rel="footnote" role="doc-noteref">[footnote 4]</a></sup>.</p>
1080
1113
 
1081
1114
  <div class="legislative-list-wrapper">
1082
1115
  <ol class="legislative-list">
1083
- <li>1. Item 1<sup id="fnref:5" role="doc-noteref"><a href="#fn:5" class="footnote" rel="footnote">[footnote 5]</a></sup>
1116
+ <li>1. Item 1<sup id="fnref:5"><a href="#fn:5" class="footnote" rel="footnote" role="doc-noteref">[footnote 5]</a></sup>
1084
1117
  </li>
1085
- <li>2. Item 2<sup id="fnref:6" role="doc-noteref"><a href="#fn:6" class="footnote" rel="footnote">[footnote 6]</a></sup>
1118
+ <li>2. Item 2<sup id="fnref:6"><a href="#fn:6" class="footnote" rel="footnote" role="doc-noteref">[footnote 6]</a></sup>
1086
1119
  </li>
1087
- <li>3. Item 3<sup id="fnref:7" role="doc-noteref"><a href="#fn:7" class="footnote" rel="footnote">[footnote 7]</a></sup>
1120
+ <li>3. Item 3<sup id="fnref:7"><a href="#fn:7" class="footnote" rel="footnote" role="doc-noteref">[footnote 7]</a></sup>
1088
1121
  </li>
1089
1122
  </ol>
1090
1123
  </div>
1091
1124
 
1092
- <p>This is a paragraph with a footnote<sup id="fnref:8" role="doc-noteref"><a href="#fn:8" class="footnote" rel="footnote">[footnote 8]</a></sup>.</p>
1125
+ <p>This is a paragraph with a footnote<sup id="fnref:8"><a href="#fn:8" class="footnote" rel="footnote" role="doc-noteref">[footnote 8]</a></sup>.</p>
1093
1126
 
1094
1127
  <div class="legislative-list-wrapper">
1095
1128
  <ol class="legislative-list">
1096
- <li>1. Item 1<sup id="fnref:9" role="doc-noteref"><a href="#fn:9" class="footnote" rel="footnote">[footnote 9]</a></sup>
1129
+ <li>1. Item 1<sup id="fnref:9"><a href="#fn:9" class="footnote" rel="footnote" role="doc-noteref">[footnote 9]</a></sup>
1097
1130
  </li>
1098
- <li>2. Item 2<sup id="fnref:10" role="doc-noteref"><a href="#fn:10" class="footnote" rel="footnote">[footnote 10]</a></sup>
1131
+ <li>2. Item 2<sup id="fnref:10"><a href="#fn:10" class="footnote" rel="footnote" role="doc-noteref">[footnote 10]</a></sup>
1099
1132
  </li>
1100
- <li>3. Item 3<sup id="fnref:11" role="doc-noteref"><a href="#fn:11" class="footnote" rel="footnote">[footnote 11]</a></sup>
1133
+ <li>3. Item 3<sup id="fnref:11"><a href="#fn:11" class="footnote" rel="footnote" role="doc-noteref">[footnote 11]</a></sup>
1101
1134
  </li>
1102
1135
  </ol>
1103
1136
  </div>
1104
1137
 
1105
- <p>This is a paragraph with a footnote<sup id="fnref:12" role="doc-noteref"><a href="#fn:12" class="footnote" rel="footnote">[footnote 12]</a></sup>.</p>
1138
+ <p>This is a paragraph with a footnote<sup id="fnref:12"><a href="#fn:12" class="footnote" rel="footnote" role="doc-noteref">[footnote 12]</a></sup>.</p>
1106
1139
 
1107
1140
  <div class="footnotes" role="doc-endnotes">
1108
1141
  <ol>
1109
- <li id="fn:1" role="doc-endnote">
1142
+ <li id="fn:1">
1110
1143
  <p>Footnote definition 1 <a href="#fnref:1" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
1111
1144
  </li>
1112
- <li id="fn:2" role="doc-endnote">
1145
+ <li id="fn:2">
1113
1146
  <p>Footnote definition 2 <a href="#fnref:2" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
1114
1147
  </li>
1115
- <li id="fn:3" role="doc-endnote">
1148
+ <li id="fn:3">
1116
1149
  <p>Footnote definition 3 <a href="#fnref:3" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
1117
1150
  </li>
1118
- <li id="fn:4" role="doc-endnote">
1151
+ <li id="fn:4">
1119
1152
  <p>Footnote definition 4 <a href="#fnref:4" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
1120
1153
  </li>
1121
- <li id="fn:5" role="doc-endnote">
1154
+ <li id="fn:5">
1122
1155
  <p>Footnote definition 5 <a href="#fnref:5" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
1123
1156
  </li>
1124
- <li id="fn:6" role="doc-endnote">
1157
+ <li id="fn:6">
1125
1158
  <p>Footnote definition 6 <a href="#fnref:6" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
1126
1159
  </li>
1127
- <li id="fn:7" role="doc-endnote">
1160
+ <li id="fn:7">
1128
1161
  <p>Footnote definition 7 <a href="#fnref:7" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
1129
1162
  </li>
1130
- <li id="fn:8" role="doc-endnote">
1163
+ <li id="fn:8">
1131
1164
  <p>Footnote definition 8 <a href="#fnref:8" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
1132
1165
  </li>
1133
- <li id="fn:9" role="doc-endnote">
1166
+ <li id="fn:9">
1134
1167
  <p>Footnote definition 9 <a href="#fnref:9" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
1135
1168
  </li>
1136
- <li id="fn:10" role="doc-endnote">
1169
+ <li id="fn:10">
1137
1170
  <p>Footnote definition 10 <a href="#fnref:10" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
1138
1171
  </li>
1139
- <li id="fn:11" role="doc-endnote">
1172
+ <li id="fn:11">
1140
1173
  <p>Footnote definition 11 <a href="#fnref:11" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
1141
1174
  </li>
1142
- <li id="fn:12" role="doc-endnote">
1175
+ <li id="fn:12">
1143
1176
  <p>Footnote definition 12 <a href="#fnref:12" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
1144
1177
  </li>
1145
1178
  </ol>
@@ -1162,21 +1195,21 @@ Teston
1162
1195
  assert_html_output %(
1163
1196
  <div class="legislative-list-wrapper">
1164
1197
  <ol class="legislative-list">
1165
- <li>1. Item 1<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">[footnote 1]</a></sup> with a <a href="http://www.gov.uk">link</a>
1198
+ <li>1. Item 1<sup id="fnref:1"><a href="#fn:1" class="footnote" rel="footnote" role="doc-noteref">[footnote 1]</a></sup> with a <a href="http://www.gov.uk">link</a>
1166
1199
  </li>
1167
1200
  <li>2. Item 2</li>
1168
1201
  <li>3. Item 3</li>
1169
1202
  </ol>
1170
1203
  </div>
1171
1204
 
1172
- <p>This is a paragraph with a footnote<sup id="fnref:2" role="doc-noteref"><a href="#fn:2" class="footnote" rel="footnote">[footnote 2]</a></sup></p>
1205
+ <p>This is a paragraph with a footnote<sup id="fnref:2"><a href="#fn:2" class="footnote" rel="footnote" role="doc-noteref">[footnote 2]</a></sup></p>
1173
1206
 
1174
1207
  <div class="footnotes" role="doc-endnotes">
1175
1208
  <ol>
1176
- <li id="fn:1" role="doc-endnote">
1209
+ <li id="fn:1">
1177
1210
  <p>Footnote definition one <a href="#fnref:1" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
1178
1211
  </li>
1179
- <li id="fn:2" role="doc-endnote">
1212
+ <li id="fn:2">
1180
1213
  <p>Footnote definition two <a href="#fnref:2" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
1181
1214
  </li>
1182
1215
  </ol>
@@ -1197,20 +1230,20 @@ Teston
1197
1230
  assert_html_output %(
1198
1231
  <div class="legislative-list-wrapper">
1199
1232
  <ol class="legislative-list">
1200
- <li>1. Item 1<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">[footnote 1]</a></sup> with a <a href="http://www.gov.uk">link</a>
1233
+ <li>1. Item 1<sup id="fnref:1"><a href="#fn:1" class="footnote" rel="footnote" role="doc-noteref">[footnote 1]</a></sup> with a <a href="http://www.gov.uk">link</a>
1201
1234
  </li>
1202
1235
  <li>2. Item 2</li>
1203
- <li>3. Item 3<sup id="fnref:2" role="doc-noteref"><a href="#fn:2" class="footnote" rel="footnote">[footnote 2]</a></sup>
1236
+ <li>3. Item 3<sup id="fnref:2"><a href="#fn:2" class="footnote" rel="footnote" role="doc-noteref">[footnote 2]</a></sup>
1204
1237
  </li>
1205
1238
  </ol>
1206
1239
  </div>
1207
1240
 
1208
1241
  <div class="footnotes" role="doc-endnotes">
1209
1242
  <ol>
1210
- <li id="fn:1" role="doc-endnote">
1243
+ <li id="fn:1">
1211
1244
  <p>Footnote definition one with a <a href="http://www.gov.uk">link</a> included <a href="#fnref:1" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
1212
1245
  </li>
1213
- <li id="fn:2" role="doc-endnote">
1246
+ <li id="fn:2">
1214
1247
  <p>Footnote definition two with an external <a rel="external" href="http://www.google.com">link</a> <a href="#fnref:2" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
1215
1248
  </li>
1216
1249
  </ol>
@@ -1226,12 +1259,12 @@ Teston
1226
1259
  " do
1227
1260
  assert_html_output %(
1228
1261
  <div class="legislative-list-wrapper">
1229
- <p>1. some text<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">[footnote 1]</a></sup>:</p>
1262
+ <p>1. some text<sup id="fnref:1"><a href="#fn:1" class="footnote" rel="footnote" role="doc-noteref">[footnote 1]</a></sup>:</p>
1230
1263
  </div>
1231
1264
 
1232
1265
  <div class="footnotes" role="doc-endnotes">
1233
1266
  <ol>
1234
- <li id="fn:1" role="doc-endnote">
1267
+ <li id="fn:1">
1235
1268
  <p>footnote text <a href="#fnref:1" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
1236
1269
  </li>
1237
1270
  </ol>
@@ -1247,12 +1280,12 @@ Teston
1247
1280
  " do
1248
1281
  assert_html_output %(
1249
1282
  <div class="legislative-list-wrapper">
1250
- <p>1. some text<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">[footnote 1]</a></sup>: extra</p>
1283
+ <p>1. some text<sup id="fnref:1"><a href="#fn:1" class="footnote" rel="footnote" role="doc-noteref">[footnote 1]</a></sup>: extra</p>
1251
1284
  </div>
1252
1285
 
1253
1286
  <div class="footnotes" role="doc-endnotes">
1254
1287
  <ol>
1255
- <li id="fn:1" role="doc-endnote">
1288
+ <li id="fn:1">
1256
1289
  <p>footnote text <a href="#fnref:1" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
1257
1290
  </li>
1258
1291
  </ol>
@@ -1318,24 +1351,24 @@ Teston
1318
1351
  assert_html_output %(
1319
1352
  <div class="legislative-list-wrapper">
1320
1353
  <ol class="legislative-list">
1321
- <li>1. Item 1<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">[footnote 1]</a></sup> with an <abbr title="This is the acronym explanation">ACRONYM</abbr>
1354
+ <li>1. Item 1<sup id="fnref:1"><a href="#fn:1" class="footnote" rel="footnote" role="doc-noteref">[footnote 1]</a></sup> with an <abbr title="This is the acronym explanation">ACRONYM</abbr>
1322
1355
  </li>
1323
- <li>2. Item 2<sup id="fnref:2" role="doc-noteref"><a href="#fn:2" class="footnote" rel="footnote">[footnote 2]</a></sup>
1356
+ <li>2. Item 2<sup id="fnref:2"><a href="#fn:2" class="footnote" rel="footnote" role="doc-noteref">[footnote 2]</a></sup>
1324
1357
  </li>
1325
- <li>3. Item 3<sup id="fnref:3" role="doc-noteref"><a href="#fn:3" class="footnote" rel="footnote">[footnote 3]</a></sup>
1358
+ <li>3. Item 3<sup id="fnref:3"><a href="#fn:3" class="footnote" rel="footnote" role="doc-noteref">[footnote 3]</a></sup>
1326
1359
  </li>
1327
1360
  </ol>
1328
1361
  </div>
1329
1362
 
1330
1363
  <div class="footnotes" role="doc-endnotes">
1331
1364
  <ol>
1332
- <li id="fn:1" role="doc-endnote">
1365
+ <li id="fn:1">
1333
1366
  <p>Footnote definition one <a href="#fnref:1" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
1334
1367
  </li>
1335
- <li id="fn:2" role="doc-endnote">
1368
+ <li id="fn:2">
1336
1369
  <p>Footnote definition two with an <abbr title="This is the acronym explanation">ACRONYM</abbr> <a href="#fnref:2" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
1337
1370
  </li>
1338
- <li id="fn:3" role="doc-endnote">
1371
+ <li id="fn:3">
1339
1372
  <p>Footnote definition three with an acronym that matches an HTML tag <abbr title="Testing HTML matching">class</abbr> <a href="#fnref:3" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
1340
1373
  </li>
1341
1374
  </ol>
@@ -1427,12 +1460,12 @@ Teston
1427
1460
  " do
1428
1461
  assert_html_output %(
1429
1462
  <div class="legislative-list-wrapper">
1430
- <p>Welcome to the <abbr title="The official UK government website">GOV.UK</abbr><sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">[footnote 1]</a></sup></p>
1463
+ <p>Welcome to the <abbr title="The official UK government website">GOV.UK</abbr><sup id="fnref:1"><a href="#fn:1" class="footnote" rel="footnote" role="doc-noteref">[footnote 1]</a></sup></p>
1431
1464
  </div>
1432
1465
 
1433
1466
  <div class="footnotes" role="doc-endnotes">
1434
1467
  <ol>
1435
- <li id="fn:1" role="doc-endnote">
1468
+ <li id="fn:1">
1436
1469
  <p><abbr title="The official UK government website">GOV.UK</abbr> is the official UK government <abbr title="A collection of web pages, such as GOV.UK">website</abbr> <a href="#fnref:1" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
1437
1470
  </li>
1438
1471
  </ol>
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govspeak
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.7.0
4
+ version: 8.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-11-18 00:00:00.000000000 Z
10
+ date: 2024-12-18 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: actionview
@@ -107,7 +106,7 @@ dependencies:
107
106
  version: 2.3.1
108
107
  - - "<"
109
108
  - !ruby/object:Gem::Version
110
- version: 2.4.1
109
+ version: 2.5.2
111
110
  type: :runtime
112
111
  prerelease: false
113
112
  version_requirements: !ruby/object:Gem::Requirement
@@ -117,7 +116,7 @@ dependencies:
117
116
  version: 2.3.1
118
117
  - - "<"
119
118
  - !ruby/object:Gem::Version
120
- version: 2.4.1
119
+ version: 2.5.2
121
120
  - !ruby/object:Gem::Dependency
122
121
  name: nokogiri
123
122
  requirement: !ruby/object:Gem::Requirement
@@ -208,14 +207,14 @@ dependencies:
208
207
  requirements:
209
208
  - - '='
210
209
  - !ruby/object:Gem::Version
211
- version: 5.0.2
210
+ version: 5.0.5
212
211
  type: :development
213
212
  prerelease: false
214
213
  version_requirements: !ruby/object:Gem::Requirement
215
214
  requirements:
216
215
  - - '='
217
216
  - !ruby/object:Gem::Version
218
- version: 5.0.2
217
+ version: 5.0.5
219
218
  - !ruby/object:Gem::Dependency
220
219
  name: simplecov
221
220
  requirement: !ruby/object:Gem::Requirement
@@ -329,7 +328,6 @@ files:
329
328
  homepage: http://github.com/alphagov/govspeak
330
329
  licenses: []
331
330
  metadata: {}
332
- post_install_message:
333
331
  rdoc_options: []
334
332
  require_paths:
335
333
  - lib
@@ -344,8 +342,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
344
342
  - !ruby/object:Gem::Version
345
343
  version: '0'
346
344
  requirements: []
347
- rubygems_version: 3.5.23
348
- signing_key:
345
+ rubygems_version: 3.6.1
349
346
  specification_version: 4
350
347
  summary: Markup language for single domain
351
348
  test_files: