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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/govspeak/post_processor.rb +10 -0
- data/lib/govspeak/version.rb +1 -1
- data/test/govspeak_footnote_test.rb +31 -0
- metadata +26 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26ef4d3bfb3ed9dcf07d44a1428e815928a4fa1ee94f388de829bb999b3cd79c
|
4
|
+
data.tar.gz: c2982f083911dcaf38a0883d48e9ca302a3b514b7bc05b99b827830c02db884d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f75532f9905ae86df812be38a837d60abe1007cad72e8d886c95019f2563734a9e136368b74c1d1499d41bc8c83b2c3a41f415128c93c7025c4f4aacb9765e6f
|
7
|
+
data.tar.gz: e6ef52ca611f2b3e74e77a3330ddaf602385eb90685b3839c8bd28f4bdf06c21652c50cff4a85fc2b157e8e009e11c5ce9c7c439a92d5abdf78821725fbaba2c
|
data/CHANGELOG.md
CHANGED
@@ -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)
|
data/lib/govspeak/version.rb
CHANGED
@@ -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.
|
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-
|
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.
|
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.
|
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/
|
384
|
-
- test/
|
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/
|
390
|
-
- test/
|
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
|