govspeak 6.5.7 → 6.5.8

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: f6cd5f76c1c1a80f74d86785f10b591bdfc1f75f2e6b2dcf874e8b39ab0e213c
4
- data.tar.gz: 4be63d972c6fd0acd9a09120930760230e45ffd59522689177602d977b9443ba
3
+ metadata.gz: 26ef4d3bfb3ed9dcf07d44a1428e815928a4fa1ee94f388de829bb999b3cd79c
4
+ data.tar.gz: c2982f083911dcaf38a0883d48e9ca302a3b514b7bc05b99b827830c02db884d
5
5
  SHA512:
6
- metadata.gz: 6ef225809fc1434259a89d44f5d5c48f9afed99dabe5b81306347a19fe50df08ecbc1c906fa2ee704a9f63b3d9448d88ddeaa1ef110a49c99ba6441da299a0c5
7
- data.tar.gz: ce7ec875cb1b33b353469846ba9c5226fbffc13551ef74cb92508e5ca7f76f1519b1c6a9b288d9978b52c16cc9fa9cb7c7500c5f3fedbc35c9c846e0faa029e2
6
+ metadata.gz: f75532f9905ae86df812be38a837d60abe1007cad72e8d886c95019f2563734a9e136368b74c1d1499d41bc8c83b2c3a41f415128c93c7025c4f4aacb9765e6f
7
+ data.tar.gz: e6ef52ca611f2b3e74e77a3330ddaf602385eb90685b3839c8bd28f4bdf06c21652c50cff4a85fc2b157e8e009e11c5ce9c7c439a92d5abdf78821725fbaba2c
@@ -1,3 +1,7 @@
1
+ ## 6.5.8
2
+
3
+ * Customise footnote markup for accessibility (PR#192)
4
+
1
5
  ## 6.5.7
2
6
 
3
7
  * Update GOV.UK Publishing components to version to 23.0.0 or greater
@@ -120,6 +120,16 @@ module Govspeak
120
120
  end
121
121
  end
122
122
 
123
+ extension("use custom footnotes") do |document|
124
+ document.css("a.footnote").map do |el|
125
+ footnote_number = el[:href].gsub(/\D/, "")
126
+ el.content = "[footnote #{footnote_number}]"
127
+ end
128
+ document.css("[role='doc-backlink']").map do |el|
129
+ el.content = "[go to where this is referenced]"
130
+ end
131
+ end
132
+
123
133
  attr_reader :input, :govspeak_document
124
134
 
125
135
  def initialize(html, govspeak_document)
@@ -1,3 +1,3 @@
1
1
  module Govspeak
2
- VERSION = "6.5.7".freeze
2
+ VERSION = "6.5.8".freeze
3
3
  end
@@ -0,0 +1,31 @@
1
+ require "test_helper"
2
+ require "govspeak_test_helper"
3
+
4
+ class GovspeakFootnoteTest < Minitest::Test
5
+ include GovspeakTestHelper
6
+
7
+ test_given_govspeak "
8
+ Footnotes can be added[^1].
9
+
10
+ [^1]: And then later defined.
11
+
12
+ Footnotes can be added too[^2].
13
+
14
+ [^2]: And then later defined too." do
15
+ assert_html_output '
16
+ <p>Footnotes can be added<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote">[footnote 1]</a></sup>.</p>
17
+
18
+ <p>Footnotes can be added too<sup id="fnref:2" role="doc-noteref"><a href="#fn:2" class="footnote">[footnote 2]</a></sup>.</p>
19
+
20
+ <div class="footnotes" role="doc-endnotes">
21
+ <ol>
22
+ <li id="fn:1" role="doc-endnote">
23
+ <p>And then later defined. <a href="#fnref:1" class="reversefootnote" role="doc-backlink">[go to where this is referenced]</a></p>
24
+ </li>
25
+ <li id="fn:2" role="doc-endnote">
26
+ <p>And then later defined too. <a href="#fnref:2" class="reversefootnote" role="doc-backlink">[go to where this is referenced]</a></p>
27
+ </li>
28
+ </ol>
29
+ </div>'
30
+ end
31
+ end
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.5.7
4
+ version: 6.5.8
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: 2020-11-03 00:00:00.000000000 Z
11
+ date: 2020-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionview
@@ -54,16 +54,22 @@ dependencies:
54
54
  name: govuk_publishing_components
55
55
  requirement: !ruby/object:Gem::Requirement
56
56
  requirements:
57
- - - "~>"
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: '23.0'
60
+ - - "<"
58
61
  - !ruby/object:Gem::Version
59
- version: 23.0.0
62
+ version: '23.4'
60
63
  type: :runtime
61
64
  prerelease: false
62
65
  version_requirements: !ruby/object:Gem::Requirement
63
66
  requirements:
64
- - - "~>"
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '23.0'
70
+ - - "<"
65
71
  - !ruby/object:Gem::Version
66
- version: 23.0.0
72
+ version: '23.4'
67
73
  - !ruby/object:Gem::Dependency
68
74
  name: htmlentities
69
75
  requirement: !ruby/object:Gem::Requirement
@@ -336,6 +342,7 @@ files:
336
342
  - test/govspeak_button_test.rb
337
343
  - test/govspeak_contacts_test.rb
338
344
  - test/govspeak_extract_contact_content_ids_test.rb
345
+ - test/govspeak_footnote_test.rb
339
346
  - test/govspeak_images_bang_test.rb
340
347
  - test/govspeak_images_test.rb
341
348
  - test/govspeak_link_extractor_test.rb
@@ -371,23 +378,24 @@ signing_key:
371
378
  specification_version: 4
372
379
  summary: Markup language for single domain
373
380
  test_files:
381
+ - test/govspeak_footnote_test.rb
382
+ - test/html_sanitizer_test.rb
383
+ - test/govspeak_test.rb
374
384
  - test/test_helper.rb
375
385
  - test/blockquote_extra_quote_remover_test.rb
376
- - test/govspeak_images_bang_test.rb
377
- - test/govspeak_contacts_test.rb
378
- - test/govspeak_table_with_headers_test.rb
379
- - test/govspeak_link_extractor_test.rb
380
- - test/govspeak_attachments_image_test.rb
381
- - test/html_validator_test.rb
382
386
  - test/govspeak_button_test.rb
383
- - test/govspeak_extract_contact_content_ids_test.rb
384
- - test/govspeak_test_helper.rb
387
+ - test/html_validator_test.rb
388
+ - test/govspeak_link_extractor_test.rb
389
+ - test/govspeak_attachment_link_test.rb
385
390
  - test/govspeak_link_test.rb
391
+ - test/govspeak_contacts_test.rb
386
392
  - test/govspeak_structured_headers_test.rb
387
- - test/html_sanitizer_test.rb
388
393
  - test/govspeak_images_test.rb
389
- - test/govspeak_test.rb
390
- - test/govspeak_attachment_link_test.rb
394
+ - test/govspeak_extract_contact_content_ids_test.rb
395
+ - test/govspeak_table_with_headers_test.rb
391
396
  - test/govspeak_attachment_test.rb
392
- - test/presenters/h_card_presenter_test.rb
393
397
  - test/govspeak_attachments_inline_test.rb
398
+ - test/presenters/h_card_presenter_test.rb
399
+ - test/govspeak_test_helper.rb
400
+ - test/govspeak_images_bang_test.rb
401
+ - test/govspeak_attachments_image_test.rb