govspeak 6.7.2 → 6.7.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/govspeak/version.rb +1 -1
- data/lib/govspeak.rb +1 -1
- data/test/govspeak_test.rb +139 -0
- metadata +18 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3fb6617b89131244243bd9fcc7317e6c28266122a75eb01f7e2164cd2d46775
|
4
|
+
data.tar.gz: d6241111b4db6cee72273862559d27abd842a83171cd044069ca370c20f3e0e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ed67517b5fdf63bd9e5e8e95510d801ea4457ed7fb290777f72d263802b67bd9cf30a4644b99edc6c11571bd93a9b61862e076e2d68fe43973b083d6bab98df
|
7
|
+
data.tar.gz: 58f86183335235a8b07cd059fe82e509e5e9701bbbbab02af250598778a720c65e136fb29e505acfe3a68727aeb09ae5e7b4d18cca20b93f67bfd3d940082fb1
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,11 @@
|
|
2
2
|
|
3
3
|
* Minimum Ruby version specified at 2.6 [215](https://github.com/alphagov/govspeak/pull/215)
|
4
4
|
|
5
|
+
## 6.7.3
|
6
|
+
|
7
|
+
* Fix regex for footnotes in legislative lists [218](
|
8
|
+
https://github.com/alphagov/govspeak/pull/218
|
9
|
+
|
5
10
|
## 6.7.2
|
6
11
|
|
7
12
|
* Fix footnotes in legislative lists [216](https://github.com/alphagov/govspeak/pull/216)
|
data/lib/govspeak/version.rb
CHANGED
data/lib/govspeak.rb
CHANGED
@@ -135,7 +135,7 @@ module Govspeak
|
|
135
135
|
|
136
136
|
def legislative_list_footnote_definitions(source)
|
137
137
|
is_legislative_list = source.scan(/\$LegislativeList.*?\[\^\d\]*.*?\$EndLegislativeList/m).size.positive?
|
138
|
-
footnotes = source.scan(/\[\^(\d)\]:(.*)/)
|
138
|
+
footnotes = source.scan(/\[\^(\d+)\]:(.*)/)
|
139
139
|
@acronyms = source.scan(/(?<=\*)\[(.*)\]:(.*)/)
|
140
140
|
|
141
141
|
if is_legislative_list && footnotes.size.positive?
|
data/test/govspeak_test.rb
CHANGED
@@ -685,6 +685,145 @@ Teston
|
|
685
685
|
)
|
686
686
|
end
|
687
687
|
|
688
|
+
test_given_govspeak "
|
689
|
+
$LegislativeList
|
690
|
+
* 1. Item 1[^1]
|
691
|
+
* 2. Item 2[^2]
|
692
|
+
* 3. Item 3[^3]
|
693
|
+
$EndLegislativeList
|
694
|
+
|
695
|
+
This is a paragraph with a footnote[^4].
|
696
|
+
|
697
|
+
$LegislativeList
|
698
|
+
* 1. Item 1[^5]
|
699
|
+
* 2. Item 2[^6]
|
700
|
+
* 3. Item 3[^7]
|
701
|
+
$EndLegislativeList
|
702
|
+
|
703
|
+
This is a paragraph with a footnote[^8].
|
704
|
+
|
705
|
+
$LegislativeList
|
706
|
+
* 1. Item 1[^9]
|
707
|
+
* 2. Item 2[^10]
|
708
|
+
* 3. Item 3[^11]
|
709
|
+
$EndLegislativeList
|
710
|
+
|
711
|
+
This is a paragraph with a footnote[^12].
|
712
|
+
|
713
|
+
[^1]: Footnote definition 1
|
714
|
+
[^2]: Footnote definition 2
|
715
|
+
[^3]: Footnote definition 3
|
716
|
+
[^4]: Footnote definition 4
|
717
|
+
[^5]: Footnote definition 5
|
718
|
+
[^6]: Footnote definition 6
|
719
|
+
[^7]: Footnote definition 7
|
720
|
+
[^8]: Footnote definition 8
|
721
|
+
[^9]: Footnote definition 9
|
722
|
+
[^10]: Footnote definition 10
|
723
|
+
[^11]: Footnote definition 11
|
724
|
+
[^12]: Footnote definition 12
|
725
|
+
" do
|
726
|
+
assert_html_output %(
|
727
|
+
<ol class="legislative-list">
|
728
|
+
<li>1. Item 1<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">[footnote 1]</a></sup>
|
729
|
+
</li>
|
730
|
+
<li>2. Item 2<sup id="fnref:2" role="doc-noteref"><a href="#fn:2" class="footnote" rel="footnote">[footnote 2]</a></sup>
|
731
|
+
</li>
|
732
|
+
<li>3. Item 3<sup id="fnref:3" role="doc-noteref"><a href="#fn:3" class="footnote" rel="footnote">[footnote 3]</a></sup>
|
733
|
+
</li>
|
734
|
+
</ol>
|
735
|
+
|
736
|
+
<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>
|
737
|
+
|
738
|
+
<ol class="legislative-list">
|
739
|
+
<li>1. Item 1<sup id="fnref:5" role="doc-noteref"><a href="#fn:5" class="footnote" rel="footnote">[footnote 5]</a></sup>
|
740
|
+
</li>
|
741
|
+
<li>2. Item 2<sup id="fnref:6" role="doc-noteref"><a href="#fn:6" class="footnote" rel="footnote">[footnote 6]</a></sup>
|
742
|
+
</li>
|
743
|
+
<li>3. Item 3<sup id="fnref:7" role="doc-noteref"><a href="#fn:7" class="footnote" rel="footnote">[footnote 7]</a></sup>
|
744
|
+
</li>
|
745
|
+
</ol>
|
746
|
+
|
747
|
+
<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>
|
748
|
+
|
749
|
+
<ol class="legislative-list">
|
750
|
+
<li>1. Item 1<sup id="fnref:9" role="doc-noteref"><a href="#fn:9" class="footnote" rel="footnote">[footnote 9]</a></sup>
|
751
|
+
</li>
|
752
|
+
<li>2. Item 2<sup id="fnref:10" role="doc-noteref"><a href="#fn:10" class="footnote" rel="footnote">[footnote 10]</a></sup>
|
753
|
+
</li>
|
754
|
+
<li>3. Item 3<sup id="fnref:11" role="doc-noteref"><a href="#fn:11" class="footnote" rel="footnote">[footnote 11]</a></sup>
|
755
|
+
</li>
|
756
|
+
</ol>
|
757
|
+
|
758
|
+
<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>
|
759
|
+
|
760
|
+
<div class="footnotes" role="doc-endnotes">
|
761
|
+
<ol>
|
762
|
+
<li id="fn:1" role="doc-endnote">
|
763
|
+
<p>
|
764
|
+
Footnote definition 1<a href="#fnref:1" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a>
|
765
|
+
</p>
|
766
|
+
</li>
|
767
|
+
<li id="fn:2" role="doc-endnote">
|
768
|
+
<p>
|
769
|
+
Footnote definition 2<a href="#fnref:2" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a>
|
770
|
+
</p>
|
771
|
+
</li>
|
772
|
+
<li id="fn:3" role="doc-endnote">
|
773
|
+
<p>
|
774
|
+
Footnote definition 3<a href="#fnref:3" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a>
|
775
|
+
</p>
|
776
|
+
</li>
|
777
|
+
<li id="fn:4" role="doc-endnote">
|
778
|
+
<p>
|
779
|
+
Footnote definition 4<a href="#fnref:4" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a>
|
780
|
+
</p>
|
781
|
+
</li>
|
782
|
+
<li id="fn:5" role="doc-endnote">
|
783
|
+
<p>
|
784
|
+
Footnote definition 5<a href="#fnref:5" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a>
|
785
|
+
</p>
|
786
|
+
</li>
|
787
|
+
<li id="fn:6" role="doc-endnote">
|
788
|
+
<p>
|
789
|
+
Footnote definition 6<a href="#fnref:6" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a>
|
790
|
+
</p>
|
791
|
+
</li>
|
792
|
+
<li id="fn:7" role="doc-endnote">
|
793
|
+
<p>
|
794
|
+
Footnote definition 7<a href="#fnref:7" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a>
|
795
|
+
</p>
|
796
|
+
</li>
|
797
|
+
<li id="fn:8" role="doc-endnote">
|
798
|
+
<p>
|
799
|
+
Footnote definition 8<a href="#fnref:8" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a>
|
800
|
+
</p>
|
801
|
+
</li>
|
802
|
+
<li id="fn:9" role="doc-endnote">
|
803
|
+
<p>
|
804
|
+
Footnote definition 9<a href="#fnref:9" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a>
|
805
|
+
</p>
|
806
|
+
</li>
|
807
|
+
<li id="fn:10" role="doc-endnote">
|
808
|
+
<p>
|
809
|
+
Footnote definition 10<a href="#fnref:10" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a>
|
810
|
+
</p>
|
811
|
+
</li>
|
812
|
+
<li id="fn:11" role="doc-endnote">
|
813
|
+
<p>
|
814
|
+
Footnote definition 11<a href="#fnref:11" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a>
|
815
|
+
</p>
|
816
|
+
</li>
|
817
|
+
<li id="fn:12" role="doc-endnote">
|
818
|
+
<p>
|
819
|
+
Footnote definition 12<a href="#fnref:12" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a>
|
820
|
+
</p>
|
821
|
+
</li>
|
822
|
+
</ol>
|
823
|
+
</div>
|
824
|
+
)
|
825
|
+
end
|
826
|
+
|
688
827
|
test_given_govspeak "
|
689
828
|
$LegislativeList
|
690
829
|
* 1. Item 1[^1] with a [link](http://www.gov.uk)
|
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.3
|
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-09-
|
11
|
+
date: 2021-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionview
|
@@ -372,24 +372,24 @@ signing_key:
|
|
372
372
|
specification_version: 4
|
373
373
|
summary: Markup language for single domain
|
374
374
|
test_files:
|
375
|
-
- test/
|
376
|
-
- test/
|
375
|
+
- test/test_helper.rb
|
376
|
+
- test/blockquote_extra_quote_remover_test.rb
|
377
377
|
- test/govspeak_images_bang_test.rb
|
378
|
-
- test/
|
378
|
+
- test/govspeak_contacts_test.rb
|
379
|
+
- test/govspeak_table_with_headers_test.rb
|
380
|
+
- test/govspeak_link_extractor_test.rb
|
381
|
+
- test/govspeak_attachments_image_test.rb
|
382
|
+
- test/html_validator_test.rb
|
383
|
+
- test/govspeak_button_test.rb
|
379
384
|
- test/govspeak_extract_contact_content_ids_test.rb
|
380
385
|
- test/govspeak_test_helper.rb
|
381
|
-
- test/blockquote_extra_quote_remover_test.rb
|
382
|
-
- test/govspeak_attachments_inline_test.rb
|
383
|
-
- test/govspeak_attachment_test.rb
|
384
|
-
- test/test_helper.rb
|
385
|
-
- test/govspeak_test.rb
|
386
|
-
- test/presenters/h_card_presenter_test.rb
|
387
386
|
- test/govspeak_footnote_test.rb
|
388
|
-
- test/
|
389
|
-
- test/
|
390
|
-
- test/govspeak_button_test.rb
|
391
|
-
- test/govspeak_images_test.rb
|
392
|
-
- test/html_validator_test.rb
|
387
|
+
- test/govspeak_link_test.rb
|
388
|
+
- test/govspeak_structured_headers_test.rb
|
393
389
|
- test/html_sanitizer_test.rb
|
394
|
-
- test/
|
395
|
-
- test/
|
390
|
+
- test/govspeak_images_test.rb
|
391
|
+
- test/govspeak_test.rb
|
392
|
+
- test/govspeak_attachment_link_test.rb
|
393
|
+
- test/govspeak_attachment_test.rb
|
394
|
+
- test/presenters/h_card_presenter_test.rb
|
395
|
+
- test/govspeak_attachments_inline_test.rb
|