govspeak 6.8.1 → 6.8.2
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/govspeak/version.rb +1 -1
- data/lib/govspeak.rb +1 -1
- data/test/govspeak_test.rb +42 -0
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a8509b4c394ef305fd80454c6c6bdb13561332bcdedc5d0292c271387a34043c
|
|
4
|
+
data.tar.gz: a73d8175cbea307d6b8028931bd15e9b99b97f7ae7708247cc833873622a8574
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ae280e29132e39a4d85f6f095bfd45cfc0da7505b7148e0b48756c4c9fccd29af2a550257a6f972837b8f1c1495f817ee61653ee069db868e66fc5a149386553
|
|
7
|
+
data.tar.gz: d3e0c5858ebe636a50d44bb360c68bc2bee4cad547529872c51be3f42a5630d5444ccc29e4ef5437d096ecdc43386f18c27363f9bcfbeff801a86fb3f6bbc486
|
data/CHANGELOG.md
CHANGED
data/lib/govspeak/version.rb
CHANGED
data/lib/govspeak.rb
CHANGED
|
@@ -138,7 +138,7 @@ module Govspeak
|
|
|
138
138
|
def footnote_definitions(source)
|
|
139
139
|
is_legislative_list = source.scan(/\$LegislativeList.*?\[\^\d\]*.*?\$EndLegislativeList/m).size.positive?
|
|
140
140
|
is_cta = source.scan(/\$CTA.*?\[\^\d\]*.*?\$CTA/m).size.positive?
|
|
141
|
-
footnotes = source.scan(
|
|
141
|
+
footnotes = source.scan(/^\s*\[\^(\d+)\]:(.*)/)
|
|
142
142
|
@acronyms = source.scan(/(?<=\*)\[(.*)\]:(.*)/)
|
|
143
143
|
if (is_legislative_list || is_cta) && footnotes.size.positive?
|
|
144
144
|
list_items = footnotes.map do |footnote|
|
data/test/govspeak_test.rb
CHANGED
|
@@ -1048,6 +1048,48 @@ Teston
|
|
|
1048
1048
|
)
|
|
1049
1049
|
end
|
|
1050
1050
|
|
|
1051
|
+
test_given_govspeak "
|
|
1052
|
+
$LegislativeList
|
|
1053
|
+
1. some text[^1]:
|
|
1054
|
+
$EndLegislativeList
|
|
1055
|
+
[^1]: footnote text
|
|
1056
|
+
" do
|
|
1057
|
+
assert_html_output %(
|
|
1058
|
+
<p>1. some text<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">[footnote 1]</a></sup>:</p>
|
|
1059
|
+
|
|
1060
|
+
<div class="footnotes" role="doc-endnotes">
|
|
1061
|
+
<ol>
|
|
1062
|
+
<li id="fn:1" role="doc-endnote">
|
|
1063
|
+
<p>
|
|
1064
|
+
footnote text<a href="#fnref:1" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a>
|
|
1065
|
+
</p>
|
|
1066
|
+
</li>
|
|
1067
|
+
</ol>
|
|
1068
|
+
</div>
|
|
1069
|
+
)
|
|
1070
|
+
end
|
|
1071
|
+
|
|
1072
|
+
test_given_govspeak "
|
|
1073
|
+
$LegislativeList
|
|
1074
|
+
1. some text[^1]: extra
|
|
1075
|
+
$EndLegislativeList
|
|
1076
|
+
[^1]: footnote text
|
|
1077
|
+
" do
|
|
1078
|
+
assert_html_output %(
|
|
1079
|
+
<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>
|
|
1080
|
+
|
|
1081
|
+
<div class="footnotes" role="doc-endnotes">
|
|
1082
|
+
<ol>
|
|
1083
|
+
<li id="fn:1" role="doc-endnote">
|
|
1084
|
+
<p>
|
|
1085
|
+
footnote text<a href="#fnref:1" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a>
|
|
1086
|
+
</p>
|
|
1087
|
+
</li>
|
|
1088
|
+
</ol>
|
|
1089
|
+
</div>
|
|
1090
|
+
)
|
|
1091
|
+
end
|
|
1092
|
+
|
|
1051
1093
|
# FIXME: this code is buggy and replaces abbreviations in HTML tags - removing the functionality for now
|
|
1052
1094
|
# test_given_govspeak "
|
|
1053
1095
|
# $LegislativeList
|
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.8.
|
|
4
|
+
version: 6.8.2
|
|
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: 2022-03-
|
|
11
|
+
date: 2022-03-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: actionview
|
|
@@ -327,7 +327,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
327
327
|
- !ruby/object:Gem::Version
|
|
328
328
|
version: '0'
|
|
329
329
|
requirements: []
|
|
330
|
-
rubygems_version: 3.3.
|
|
330
|
+
rubygems_version: 3.3.10
|
|
331
331
|
signing_key:
|
|
332
332
|
specification_version: 4
|
|
333
333
|
summary: Markup language for single domain
|