govspeak 8.2.0 → 8.3.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 +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/govspeak/post_processor.rb +9 -0
- data/lib/govspeak/version.rb +1 -1
- data/lib/govspeak.rb +12 -86
- data/lib/kramdown/parser/govuk.rb +18 -1
- data/test/govspeak_test.rb +308 -228
- 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: 92a47d834646bd30072105c15ed418c6fbd09ad18c5469928be7d76a6cdf8d97
|
4
|
+
data.tar.gz: 94a44d03aa697a24937596786e8dff07da213ad085ca39ce52394cb040c3c7d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0e59b5d11641d737428bc419c77c749300115625442fb44b0eba026e1b3755e648a1a14ff5199c004ef18cdc72a66953f3c90feb883592dfd8e86719536068c
|
7
|
+
data.tar.gz: 3ab9bb92193243b5c0b0920260c7ae23773495d3683df54197775aef23337d743edc091a6068291d744fee7010142650e3896a6735310e7456227ab7e587465d
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
## 8.3.0
|
2
|
+
|
3
|
+
* Various bug fixes related to abbreviations in call to action and legislative list components ([#291](https://github.com/alphagov/govspeak/pull/291))
|
4
|
+
|
5
|
+
## 8.2.1
|
6
|
+
|
7
|
+
* Prevent user error when incorrectly formatted footnotes are added to HTML attachments ([#287](https://github.com/alphagov/govspeak/pull/287))
|
8
|
+
|
1
9
|
## 8.2.0
|
2
10
|
|
3
11
|
* Reintroduce support for acronyms in Call To Action blocks and in Legislative Lists ([#285](https://github.com/alphagov/govspeak/pull/285))
|
@@ -20,6 +20,15 @@ module Govspeak
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
+
extension("covert legislative list ul to ol") do |document|
|
24
|
+
document.css(".legislative-list-wrapper").map do |el|
|
25
|
+
el.inner_html = el.inner_html
|
26
|
+
.sub("<ul>", "<ol class=\"legislative-list\">")
|
27
|
+
.gsub("</ul>", "</ol>")
|
28
|
+
.gsub("<ul>", "<ol>")
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
23
32
|
# This "fix" here is tied into the rendering of images as one of the
|
24
33
|
# pre-processor tasks. As images can be created inside block level elements
|
25
34
|
# it's possible that their block level elements can be HTML entity escaped
|
data/lib/govspeak/version.rb
CHANGED
data/lib/govspeak.rb
CHANGED
@@ -63,8 +63,6 @@ module Govspeak
|
|
63
63
|
sanitize: true,
|
64
64
|
syntax_highlighter: nil }.merge(options)
|
65
65
|
@options[:entity_output] = :symbolic
|
66
|
-
@footnote_definition_html = nil
|
67
|
-
@acronyms = []
|
68
66
|
end
|
69
67
|
|
70
68
|
def to_html
|
@@ -76,16 +74,6 @@ module Govspeak
|
|
76
74
|
kramdown_doc.to_html
|
77
75
|
end
|
78
76
|
|
79
|
-
unless @footnote_definition_html.nil?
|
80
|
-
regex = /<div class="footnotes".*[<\/div>]/m
|
81
|
-
|
82
|
-
if html.scan(regex).empty?
|
83
|
-
html << @footnote_definition_html
|
84
|
-
else
|
85
|
-
html.gsub!(regex, @footnote_definition_html)
|
86
|
-
end
|
87
|
-
end
|
88
|
-
|
89
77
|
Govspeak::PostProcessor.process(html, self)
|
90
78
|
end
|
91
79
|
end
|
@@ -125,8 +113,6 @@ module Govspeak
|
|
125
113
|
source = Govspeak::BlockquoteExtraQuoteRemover.remove(source)
|
126
114
|
source = remove_forbidden_characters(source)
|
127
115
|
|
128
|
-
footnote_definitions(source)
|
129
|
-
|
130
116
|
self.class.extensions.each do |_, regexp, block|
|
131
117
|
source.gsub!(regexp) do
|
132
118
|
instance_exec(*Regexp.last_match.captures, &block)
|
@@ -135,37 +121,6 @@ module Govspeak
|
|
135
121
|
source
|
136
122
|
end
|
137
123
|
|
138
|
-
def footnote_definitions(source)
|
139
|
-
is_legislative_list = source.scan(/\$LegislativeList.*?\[\^\d\]*.*?\$EndLegislativeList/m).size.positive?
|
140
|
-
is_cta = source.scan(/\$CTA.*?\[\^\d\]*.*?\$CTA/m).size.positive?
|
141
|
-
footnotes = source.scan(/^\s*\[\^(\d+)\]:(.*)/)
|
142
|
-
@acronyms.concat(source.scan(/(?<=\*)\[(.*)\]:(.*)/))
|
143
|
-
if (is_legislative_list || is_cta) && footnotes.size.positive?
|
144
|
-
list_items = footnotes.map do |footnote|
|
145
|
-
number = footnote[0]
|
146
|
-
text = footnote[1].strip
|
147
|
-
footnote_definition = Govspeak::Document.new(text).to_html[/(?<=<p>).*(?=<\/p>)/]
|
148
|
-
footnote_definition = add_acronym_alt_text(footnote_definition)
|
149
|
-
|
150
|
-
<<~HTML_SNIPPET
|
151
|
-
<li id="fn:#{number}" role="doc-endnote">
|
152
|
-
<p>
|
153
|
-
#{footnote_definition}<a href="#fnref:#{number}" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a>
|
154
|
-
</p>
|
155
|
-
</li>
|
156
|
-
HTML_SNIPPET
|
157
|
-
end
|
158
|
-
|
159
|
-
@footnote_definition_html = <<~HTML_CONTAINER
|
160
|
-
<div class="footnotes" role="doc-endnotes">
|
161
|
-
<ol>
|
162
|
-
#{list_items.join.strip}
|
163
|
-
</ol>
|
164
|
-
</div>
|
165
|
-
HTML_CONTAINER
|
166
|
-
end
|
167
|
-
end
|
168
|
-
|
169
124
|
def remove_forbidden_characters(source)
|
170
125
|
# These are characters that are not deemed not suitable for
|
171
126
|
# markup: https://www.w3.org/TR/unicode-xml/#Charlist
|
@@ -322,20 +277,11 @@ module Govspeak
|
|
322
277
|
end
|
323
278
|
|
324
279
|
extension("call-to-action", surrounded_by("$CTA")) do |body|
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
footnotes.each do |footnote|
|
331
|
-
html = "<sup id=\"fnref:#{footnote}\" role=\"doc-noteref\">" \
|
332
|
-
"<a href=\"#fn:#{footnote}\" class=\"footnote\" rel=\"footnote\">" \
|
333
|
-
"[footnote #{footnote}]</a></sup>"
|
334
|
-
|
335
|
-
doc.sub!(/(\[\^#{footnote}\])/, html)
|
336
|
-
end
|
337
|
-
|
338
|
-
doc
|
280
|
+
<<~BODY
|
281
|
+
{::options parse_block_html=\"true\" /}
|
282
|
+
<div class="call-to-action">#{body}</div>
|
283
|
+
{::options parse_block_html=\"false\" /}
|
284
|
+
BODY
|
339
285
|
end
|
340
286
|
|
341
287
|
# More specific tags must be defined first. Those defined earlier have a
|
@@ -354,25 +300,13 @@ module Govspeak
|
|
354
300
|
end
|
355
301
|
|
356
302
|
extension("legislative list", /#{NEW_PARAGRAPH_LOOKBEHIND}\$LegislativeList\s*$(.*?)\$EndLegislativeList/m) do |body|
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
footnotes = body.scan(/\[\^(\d+)\]/).flatten
|
366
|
-
|
367
|
-
footnotes.each do |footnote|
|
368
|
-
html = "<sup id=\"fnref:#{footnote}\" role=\"doc-noteref\">" \
|
369
|
-
"<a href=\"#fn:#{footnote}\" class=\"footnote\" rel=\"footnote\">" \
|
370
|
-
"[footnote #{footnote}]</a></sup>"
|
371
|
-
|
372
|
-
doc.sub!(/(\[\^#{footnote}\])/, html)
|
373
|
-
end
|
374
|
-
end
|
375
|
-
end
|
303
|
+
# The surrounding div is neccessary to control flow in `parse_block_html` and
|
304
|
+
# maintain the same functionality as a previous version of this extension.
|
305
|
+
<<~BODY
|
306
|
+
{::options parse_block_html=\"true\" ordered_lists_disabled=\"true\" /}
|
307
|
+
<div class="legislative-list-wrapper">#{body}</div>
|
308
|
+
{::options parse_block_html=\"false\" ordered_lists_disabled=\"false\" /}
|
309
|
+
BODY
|
376
310
|
end
|
377
311
|
|
378
312
|
extension("numbered list", /^[ \t]*((s\d+\.\s.*(?:\n|$))+)/) do |body|
|
@@ -449,14 +383,6 @@ module Govspeak
|
|
449
383
|
def encode(text)
|
450
384
|
HTMLEntities.new.encode(text)
|
451
385
|
end
|
452
|
-
|
453
|
-
def add_acronym_alt_text(html)
|
454
|
-
@acronyms.each do |acronym|
|
455
|
-
html.gsub!(acronym[0], "<abbr title=\"#{acronym[1].strip}\">#{acronym[0]}</abbr>")
|
456
|
-
end
|
457
|
-
|
458
|
-
html
|
459
|
-
end
|
460
386
|
end
|
461
387
|
end
|
462
388
|
|
@@ -17,6 +17,13 @@ module Kramdown
|
|
17
17
|
DESCRIPTION
|
18
18
|
simple_array_validator(val, :document_domains, AlwaysEqual.new)
|
19
19
|
end
|
20
|
+
|
21
|
+
define(:ordered_lists_disabled, Boolean, false, <<~DESCRIPTION)
|
22
|
+
Disables ordered lists
|
23
|
+
|
24
|
+
Default: false
|
25
|
+
Used by: KramdownWithAutomaticExternalLinks
|
26
|
+
DESCRIPTION
|
20
27
|
end
|
21
28
|
|
22
29
|
module Parser
|
@@ -46,7 +53,17 @@ module Kramdown
|
|
46
53
|
def parse_block_html
|
47
54
|
return false if CUSTOM_INLINE_ELEMENTS.include?(@src[1].downcase)
|
48
55
|
|
49
|
-
super
|
56
|
+
return super unless @options[:ordered_lists_disabled]
|
57
|
+
|
58
|
+
# Kramdown loads parsers into the instance from `options` which are scoped to
|
59
|
+
# the class. Because we are changing these options inside an instance, we must
|
60
|
+
# reconfigure the parser before and after disbaling ordered lists.
|
61
|
+
Govspeak::KramdownOverrides.with_kramdown_ordered_lists_disabled do
|
62
|
+
configure_parser
|
63
|
+
super
|
64
|
+
end
|
65
|
+
|
66
|
+
configure_parser
|
50
67
|
end
|
51
68
|
end
|
52
69
|
end
|
data/test/govspeak_test.rb
CHANGED
@@ -420,13 +420,13 @@ Teston
|
|
420
420
|
$CTA" do
|
421
421
|
assert_html_output %(
|
422
422
|
<div class="call-to-action">
|
423
|
-
|
423
|
+
<p>Click here to start the tool</p>
|
424
424
|
</div>)
|
425
425
|
assert_text_output "Click here to start the tool"
|
426
426
|
end
|
427
427
|
|
428
428
|
test_given_govspeak "
|
429
|
-
Here is some text
|
429
|
+
Here is some text\n
|
430
430
|
|
431
431
|
$CTA
|
432
432
|
Click here to start the tool
|
@@ -436,7 +436,7 @@ Teston
|
|
436
436
|
<p>Here is some text</p>
|
437
437
|
|
438
438
|
<div class="call-to-action">
|
439
|
-
|
439
|
+
<p>Click here to start the tool</p>
|
440
440
|
</div>)
|
441
441
|
end
|
442
442
|
|
@@ -453,9 +453,10 @@ Teston
|
|
453
453
|
$CTA" do
|
454
454
|
assert_html_output %(
|
455
455
|
<div class="call-to-action">
|
456
|
-
<p>This is a test:</p>
|
457
456
|
|
458
|
-
|
457
|
+
<p>This is a test:</p>
|
458
|
+
|
459
|
+
<ol class="steps">
|
459
460
|
<li>
|
460
461
|
<p>This is number 1.</p>
|
461
462
|
</li>
|
@@ -480,7 +481,7 @@ Teston
|
|
480
481
|
" do
|
481
482
|
assert_html_output %(
|
482
483
|
<div class="call-to-action">
|
483
|
-
|
484
|
+
<p><a rel="external" href="http://www.external.com">external link</a> some text</p>
|
484
485
|
</div>)
|
485
486
|
end
|
486
487
|
|
@@ -490,7 +491,7 @@ Teston
|
|
490
491
|
$CTA", document_domains: %w[www.not-external.com] do
|
491
492
|
assert_html_output %(
|
492
493
|
<div class="call-to-action">
|
493
|
-
|
494
|
+
<p><a href="http://www.not-external.com">internal link</a> some text</p>
|
494
495
|
</div>)
|
495
496
|
end
|
496
497
|
|
@@ -505,7 +506,7 @@ Teston
|
|
505
506
|
" do
|
506
507
|
assert_html_output %(
|
507
508
|
<div class="call-to-action">
|
508
|
-
|
509
|
+
<p>Click here to start the tool</p>
|
509
510
|
</div>
|
510
511
|
|
511
512
|
<div class="contact">
|
@@ -514,7 +515,7 @@ Teston
|
|
514
515
|
end
|
515
516
|
|
516
517
|
test_given_govspeak "
|
517
|
-
[internal link](http://www.not-external.com)
|
518
|
+
[internal link](http://www.not-external.com)\n
|
518
519
|
|
519
520
|
$CTA
|
520
521
|
Click here to start the tool
|
@@ -523,7 +524,7 @@ Teston
|
|
523
524
|
<p><a href="http://www.not-external.com">internal link</a></p>
|
524
525
|
|
525
526
|
<div class="call-to-action">
|
526
|
-
|
527
|
+
<p>Click here to start the tool</p>
|
527
528
|
</div>)
|
528
529
|
end
|
529
530
|
|
@@ -535,15 +536,13 @@ Teston
|
|
535
536
|
" do
|
536
537
|
assert_html_output %(
|
537
538
|
<div class="call-to-action">
|
538
|
-
|
539
|
+
<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>
|
539
540
|
</div>
|
540
541
|
<div class="footnotes" role="doc-endnotes">
|
541
542
|
<ol>
|
542
543
|
<li id="fn:1" role="doc-endnote">
|
543
|
-
|
544
|
-
|
545
|
-
</p>
|
546
|
-
</li>
|
544
|
+
<p>Footnote definition one <a href="#fnref:1" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
|
545
|
+
</li>
|
547
546
|
</ol>
|
548
547
|
</div>
|
549
548
|
)
|
@@ -563,26 +562,21 @@ Teston
|
|
563
562
|
" do
|
564
563
|
assert_html_output %(
|
565
564
|
<div class="call-to-action">
|
566
|
-
|
565
|
+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
567
566
|
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>
|
568
567
|
</div>
|
569
|
-
|
570
568
|
<div class="call-to-action">
|
571
|
-
|
569
|
+
<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.
|
572
570
|
Fringilla, metus dui scelerisque est.</p>
|
573
571
|
</div>
|
574
572
|
<div class="footnotes" role="doc-endnotes">
|
575
573
|
<ol>
|
576
574
|
<li id="fn:1" role="doc-endnote">
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
<p>
|
583
|
-
Footnote definition two<a href="#fnref:2" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a>
|
584
|
-
</p>
|
585
|
-
</li>
|
575
|
+
<p>Footnote definition one <a href="#fnref:1" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
|
576
|
+
</li>
|
577
|
+
<li id="fn:2" role="doc-endnote">
|
578
|
+
<p>Footnote definition two <a href="#fnref:2" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
|
579
|
+
</li>
|
586
580
|
</ol>
|
587
581
|
</div>
|
588
582
|
)
|
@@ -600,7 +594,7 @@ Teston
|
|
600
594
|
" do
|
601
595
|
assert_html_output %(
|
602
596
|
<div class="call-to-action">
|
603
|
-
|
597
|
+
<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>
|
604
598
|
</div>
|
605
599
|
|
606
600
|
<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>
|
@@ -608,15 +602,11 @@ Teston
|
|
608
602
|
<div class="footnotes" role="doc-endnotes">
|
609
603
|
<ol>
|
610
604
|
<li id="fn:1" role="doc-endnote">
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
<p>
|
617
|
-
Footnote definition 2<a href="#fnref:2" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a>
|
618
|
-
</p>
|
619
|
-
</li>
|
605
|
+
<p>Footnote definition 1 <a href="#fnref:1" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
|
606
|
+
</li>
|
607
|
+
<li id="fn:2" role="doc-endnote">
|
608
|
+
<p>Footnote definition 2 <a href="#fnref:2" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
|
609
|
+
</li>
|
620
610
|
</ol>
|
621
611
|
</div>
|
622
612
|
)
|
@@ -632,7 +622,63 @@ Teston
|
|
632
622
|
" do
|
633
623
|
assert_html_output %(
|
634
624
|
<div class="call-to-action">
|
635
|
-
|
625
|
+
<p>Contact the <abbr title="Some Government Department">SGD</abbr> on 0800 000 0000 or contact the <abbr title="Other Government Department">class</abbr> on 0800 001 0001</p>
|
626
|
+
</div>
|
627
|
+
)
|
628
|
+
end
|
629
|
+
|
630
|
+
test_given_govspeak "
|
631
|
+
$CTA
|
632
|
+
Welcome to the GOV.UK website
|
633
|
+
$CTA
|
634
|
+
|
635
|
+
*[GOV.UK]: The official UK government website
|
636
|
+
*[website]: A collection of web pages, such as GOV.UK
|
637
|
+
" do
|
638
|
+
assert_html_output %(
|
639
|
+
<div class="call-to-action">
|
640
|
+
<p>Welcome to the <abbr title="The official UK government website">GOV.UK</abbr> <abbr title="A collection of web pages, such as GOV.UK">website</abbr></p>
|
641
|
+
</div>
|
642
|
+
)
|
643
|
+
end
|
644
|
+
|
645
|
+
test_given_govspeak "
|
646
|
+
$CTA
|
647
|
+
Please email <developer@digital.cabinet-office.GOV.UK>
|
648
|
+
$CTA
|
649
|
+
|
650
|
+
*[GOV.UK]: The official UK government website
|
651
|
+
" do
|
652
|
+
assert_html_output %(
|
653
|
+
<div class="call-to-action">
|
654
|
+
<p>Please email <a href="mailto:developer@digital.cabinet-office.GOV.UK">developer@digital.cabinet-office.<abbr title="The official UK government website">GOV.UK</abbr></a></p>
|
655
|
+
</div>
|
656
|
+
)
|
657
|
+
end
|
658
|
+
|
659
|
+
test_given_govspeak "
|
660
|
+
$CTA
|
661
|
+
Welcome to the GOV.UK[^1]
|
662
|
+
$CTA
|
663
|
+
|
664
|
+
[^1]: GOV.UK is the official UK government website
|
665
|
+
|
666
|
+
*[GOV.UK]: The official UK government website
|
667
|
+
*[website]: A collection of web pages, such as GOV.UK
|
668
|
+
|
669
|
+
*[GOV.UK]: The official UK government website
|
670
|
+
" do
|
671
|
+
assert_html_output %(
|
672
|
+
<div class="call-to-action">
|
673
|
+
<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>
|
674
|
+
</div>
|
675
|
+
|
676
|
+
<div class="footnotes" role="doc-endnotes">
|
677
|
+
<ol>
|
678
|
+
<li id="fn:1" role="doc-endnote">
|
679
|
+
<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>
|
680
|
+
</li>
|
681
|
+
</ol>
|
636
682
|
</div>
|
637
683
|
)
|
638
684
|
end
|
@@ -707,13 +753,14 @@ Teston
|
|
707
753
|
$EndLegislativeList
|
708
754
|
" do
|
709
755
|
assert_html_output %{
|
756
|
+
<div class="legislative-list-wrapper">
|
710
757
|
<ol class="legislative-list">
|
711
758
|
<li>
|
712
759
|
<p>1.0 Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
713
|
-
|
760
|
+
Fusce felis ante, lobortis non quam sit amet, tempus interdum justo.</p>
|
714
761
|
|
715
762
|
<p>Pellentesque quam enim, egestas sit amet congue sit amet, ultrices vitae arcu.
|
716
|
-
|
763
|
+
fringilla, metus dui scelerisque est.</p>
|
717
764
|
|
718
765
|
<ol>
|
719
766
|
<li>
|
@@ -726,10 +773,11 @@ Teston
|
|
726
773
|
</li>
|
727
774
|
<li>
|
728
775
|
<p>1.1 Second entry
|
729
|
-
|
730
|
-
|
776
|
+
Curabitur pretium pharetra sapien, a feugiat arcu euismod eget.
|
777
|
+
Nunc luctus ornare varius. Nulla scelerisque, justo dictum dapibus</p>
|
731
778
|
</li>
|
732
|
-
</ol>
|
779
|
+
</ol>
|
780
|
+
</div>}
|
733
781
|
end
|
734
782
|
|
735
783
|
test_given_govspeak "
|
@@ -742,6 +790,7 @@ Teston
|
|
742
790
|
$EndLegislativeList
|
743
791
|
" do
|
744
792
|
assert_html_output %{
|
793
|
+
<div class="legislative-list-wrapper">
|
745
794
|
<ol class="legislative-list">
|
746
795
|
<li>1. The quick</li>
|
747
796
|
<li>2. Brown fox
|
@@ -752,6 +801,7 @@ Teston
|
|
752
801
|
</li>
|
753
802
|
<li>3. Dog</li>
|
754
803
|
</ol>
|
804
|
+
</div>
|
755
805
|
}
|
756
806
|
end
|
757
807
|
|
@@ -766,28 +816,26 @@ Teston
|
|
766
816
|
[^2]: Footnote definition two
|
767
817
|
" do
|
768
818
|
assert_html_output %(
|
819
|
+
<div class="legislative-list-wrapper">
|
769
820
|
<ol class="legislative-list">
|
770
821
|
<li>1. Item 1<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">[footnote 1]</a></sup>
|
771
|
-
|
822
|
+
</li>
|
772
823
|
<li>2. Item 2<sup id="fnref:2" role="doc-noteref"><a href="#fn:2" class="footnote" rel="footnote">[footnote 2]</a></sup>
|
773
|
-
|
824
|
+
</li>
|
774
825
|
<li>3. Item 3</li>
|
775
826
|
</ol>
|
827
|
+
</div>
|
776
828
|
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
</p>
|
788
|
-
</li>
|
789
|
-
</ol>
|
790
|
-
</div>
|
829
|
+
<div class="footnotes" role="doc-endnotes">
|
830
|
+
<ol>
|
831
|
+
<li id="fn:1" role="doc-endnote">
|
832
|
+
<p>Footnote definition one <a href="#fnref:1" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
|
833
|
+
</li>
|
834
|
+
<li id="fn:2" role="doc-endnote">
|
835
|
+
<p>Footnote definition two <a href="#fnref:2" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
|
836
|
+
</li>
|
837
|
+
</ol>
|
838
|
+
</div>
|
791
839
|
)
|
792
840
|
end
|
793
841
|
|
@@ -811,41 +859,39 @@ Teston
|
|
811
859
|
[^3]: Footnote definition two
|
812
860
|
" do
|
813
861
|
assert_html_output %(
|
862
|
+
<div class="legislative-list-wrapper">
|
814
863
|
<ol class="legislative-list">
|
815
864
|
<li>1. Item 1<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">[footnote 1]</a></sup>
|
816
|
-
|
865
|
+
</li>
|
817
866
|
<li>2. Item 2</li>
|
818
867
|
<li>3. Item 3</li>
|
819
868
|
</ol>
|
869
|
+
</div>
|
820
870
|
|
821
|
-
|
871
|
+
<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>
|
822
872
|
|
873
|
+
<div class="legislative-list-wrapper">
|
823
874
|
<ol class="legislative-list">
|
824
875
|
<li>1. Item 1</li>
|
825
876
|
<li>2. Item 2<sup id="fnref:3" role="doc-noteref"><a href="#fn:3" class="footnote" rel="footnote">[footnote 3]</a></sup>
|
826
|
-
|
877
|
+
</li>
|
827
878
|
<li>3. Item 3</li>
|
828
879
|
</ol>
|
880
|
+
</div>
|
829
881
|
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
<
|
839
|
-
Footnote definition two<a href="#fnref:
|
840
|
-
</
|
841
|
-
</
|
842
|
-
|
843
|
-
<p>
|
844
|
-
Footnote definition two<a href="#fnref:3" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a>
|
845
|
-
</p>
|
846
|
-
</li>
|
847
|
-
</ol>
|
848
|
-
</div>
|
882
|
+
<div class="footnotes" role="doc-endnotes">
|
883
|
+
<ol>
|
884
|
+
<li id="fn:1" role="doc-endnote">
|
885
|
+
<p>Footnote definition one <a href="#fnref:1" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
|
886
|
+
</li>
|
887
|
+
<li id="fn:2" role="doc-endnote">
|
888
|
+
<p>Footnote definition two <a href="#fnref:2" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
|
889
|
+
</li>
|
890
|
+
<li id="fn:3" role="doc-endnote">
|
891
|
+
<p>Footnote definition two <a href="#fnref:3" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
|
892
|
+
</li>
|
893
|
+
</ol>
|
894
|
+
</div>
|
849
895
|
)
|
850
896
|
end
|
851
897
|
|
@@ -888,101 +934,83 @@ Teston
|
|
888
934
|
[^12]: Footnote definition 12
|
889
935
|
" do
|
890
936
|
assert_html_output %(
|
891
|
-
<
|
892
|
-
<
|
937
|
+
<div class="legislative-list-wrapper">
|
938
|
+
<ol class="legislative-list">
|
939
|
+
<li>1. Item 1<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">[footnote 1]</a></sup>
|
893
940
|
</li>
|
894
|
-
|
941
|
+
<li>2. Item 2<sup id="fnref:2" role="doc-noteref"><a href="#fn:2" class="footnote" rel="footnote">[footnote 2]</a></sup>
|
895
942
|
</li>
|
896
|
-
|
943
|
+
<li>3. Item 3<sup id="fnref:3" role="doc-noteref"><a href="#fn:3" class="footnote" rel="footnote">[footnote 3]</a></sup>
|
897
944
|
</li>
|
898
|
-
|
945
|
+
</ol>
|
946
|
+
</div>
|
899
947
|
|
900
948
|
<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>
|
901
949
|
|
902
|
-
<
|
903
|
-
<
|
950
|
+
<div class="legislative-list-wrapper">
|
951
|
+
<ol class="legislative-list">
|
952
|
+
<li>1. Item 1<sup id="fnref:5" role="doc-noteref"><a href="#fn:5" class="footnote" rel="footnote">[footnote 5]</a></sup>
|
904
953
|
</li>
|
905
|
-
|
954
|
+
<li>2. Item 2<sup id="fnref:6" role="doc-noteref"><a href="#fn:6" class="footnote" rel="footnote">[footnote 6]</a></sup>
|
906
955
|
</li>
|
907
|
-
|
956
|
+
<li>3. Item 3<sup id="fnref:7" role="doc-noteref"><a href="#fn:7" class="footnote" rel="footnote">[footnote 7]</a></sup>
|
908
957
|
</li>
|
909
|
-
|
958
|
+
</ol>
|
959
|
+
</div>
|
910
960
|
|
911
961
|
<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>
|
912
962
|
|
913
|
-
<
|
914
|
-
<
|
963
|
+
<div class="legislative-list-wrapper">
|
964
|
+
<ol class="legislative-list">
|
965
|
+
<li>1. Item 1<sup id="fnref:9" role="doc-noteref"><a href="#fn:9" class="footnote" rel="footnote">[footnote 9]</a></sup>
|
915
966
|
</li>
|
916
|
-
|
967
|
+
<li>2. Item 2<sup id="fnref:10" role="doc-noteref"><a href="#fn:10" class="footnote" rel="footnote">[footnote 10]</a></sup>
|
917
968
|
</li>
|
918
|
-
|
969
|
+
<li>3. Item 3<sup id="fnref:11" role="doc-noteref"><a href="#fn:11" class="footnote" rel="footnote">[footnote 11]</a></sup>
|
919
970
|
</li>
|
920
|
-
|
971
|
+
</ol>
|
972
|
+
</div>
|
921
973
|
|
922
974
|
<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>
|
923
975
|
|
924
976
|
<div class="footnotes" role="doc-endnotes">
|
925
977
|
<ol>
|
926
978
|
<li id="fn:1" role="doc-endnote">
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
<p>
|
963
|
-
Footnote definition 8<a href="#fnref:8" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a>
|
964
|
-
</p>
|
965
|
-
</li>
|
966
|
-
<li id="fn:9" role="doc-endnote">
|
967
|
-
<p>
|
968
|
-
Footnote definition 9<a href="#fnref:9" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a>
|
969
|
-
</p>
|
970
|
-
</li>
|
971
|
-
<li id="fn:10" role="doc-endnote">
|
972
|
-
<p>
|
973
|
-
Footnote definition 10<a href="#fnref:10" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a>
|
974
|
-
</p>
|
975
|
-
</li>
|
976
|
-
<li id="fn:11" role="doc-endnote">
|
977
|
-
<p>
|
978
|
-
Footnote definition 11<a href="#fnref:11" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a>
|
979
|
-
</p>
|
980
|
-
</li>
|
981
|
-
<li id="fn:12" role="doc-endnote">
|
982
|
-
<p>
|
983
|
-
Footnote definition 12<a href="#fnref:12" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a>
|
984
|
-
</p>
|
985
|
-
</li>
|
979
|
+
<p>Footnote definition 1 <a href="#fnref:1" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
|
980
|
+
</li>
|
981
|
+
<li id="fn:2" role="doc-endnote">
|
982
|
+
<p>Footnote definition 2 <a href="#fnref:2" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
|
983
|
+
</li>
|
984
|
+
<li id="fn:3" role="doc-endnote">
|
985
|
+
<p>Footnote definition 3 <a href="#fnref:3" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
|
986
|
+
</li>
|
987
|
+
<li id="fn:4" role="doc-endnote">
|
988
|
+
<p>Footnote definition 4 <a href="#fnref:4" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
|
989
|
+
</li>
|
990
|
+
<li id="fn:5" role="doc-endnote">
|
991
|
+
<p>Footnote definition 5 <a href="#fnref:5" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
|
992
|
+
</li>
|
993
|
+
<li id="fn:6" role="doc-endnote">
|
994
|
+
<p>Footnote definition 6 <a href="#fnref:6" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
|
995
|
+
</li>
|
996
|
+
<li id="fn:7" role="doc-endnote">
|
997
|
+
<p>Footnote definition 7 <a href="#fnref:7" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
|
998
|
+
</li>
|
999
|
+
<li id="fn:8" role="doc-endnote">
|
1000
|
+
<p>Footnote definition 8 <a href="#fnref:8" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
|
1001
|
+
</li>
|
1002
|
+
<li id="fn:9" role="doc-endnote">
|
1003
|
+
<p>Footnote definition 9 <a href="#fnref:9" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
|
1004
|
+
</li>
|
1005
|
+
<li id="fn:10" role="doc-endnote">
|
1006
|
+
<p>Footnote definition 10 <a href="#fnref:10" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
|
1007
|
+
</li>
|
1008
|
+
<li id="fn:11" role="doc-endnote">
|
1009
|
+
<p>Footnote definition 11 <a href="#fnref:11" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
|
1010
|
+
</li>
|
1011
|
+
<li id="fn:12" role="doc-endnote">
|
1012
|
+
<p>Footnote definition 12 <a href="#fnref:12" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
|
1013
|
+
</li>
|
986
1014
|
</ol>
|
987
1015
|
</div>
|
988
1016
|
)
|
@@ -1001,29 +1029,27 @@ Teston
|
|
1001
1029
|
[^2]: Footnote definition two
|
1002
1030
|
" do
|
1003
1031
|
assert_html_output %(
|
1032
|
+
<div class="legislative-list-wrapper">
|
1004
1033
|
<ol class="legislative-list">
|
1005
1034
|
<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>
|
1006
|
-
|
1035
|
+
</li>
|
1007
1036
|
<li>2. Item 2</li>
|
1008
1037
|
<li>3. Item 3</li>
|
1009
1038
|
</ol>
|
1039
|
+
</div>
|
1010
1040
|
|
1011
|
-
|
1041
|
+
<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>
|
1012
1042
|
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
|
1023
|
-
</p>
|
1024
|
-
</li>
|
1025
|
-
</ol>
|
1026
|
-
</div>
|
1043
|
+
<div class="footnotes" role="doc-endnotes">
|
1044
|
+
<ol>
|
1045
|
+
<li id="fn:1" role="doc-endnote">
|
1046
|
+
<p>Footnote definition one <a href="#fnref:1" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
|
1047
|
+
</li>
|
1048
|
+
<li id="fn:2" role="doc-endnote">
|
1049
|
+
<p>Footnote definition two <a href="#fnref:2" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
|
1050
|
+
</li>
|
1051
|
+
</ol>
|
1052
|
+
</div>
|
1027
1053
|
)
|
1028
1054
|
end
|
1029
1055
|
|
@@ -1038,28 +1064,26 @@ Teston
|
|
1038
1064
|
[^2]: Footnote definition two with an external [link](http://www.google.com)
|
1039
1065
|
" do
|
1040
1066
|
assert_html_output %(
|
1067
|
+
<div class="legislative-list-wrapper">
|
1041
1068
|
<ol class="legislative-list">
|
1042
1069
|
<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>
|
1043
|
-
|
1070
|
+
</li>
|
1044
1071
|
<li>2. Item 2</li>
|
1045
1072
|
<li>3. Item 3<sup id="fnref:2" role="doc-noteref"><a href="#fn:2" class="footnote" rel="footnote">[footnote 2]</a></sup>
|
1046
|
-
|
1073
|
+
</li>
|
1047
1074
|
</ol>
|
1075
|
+
</div>
|
1048
1076
|
|
1049
|
-
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
</p>
|
1060
|
-
</li>
|
1061
|
-
</ol>
|
1062
|
-
</div>
|
1077
|
+
<div class="footnotes" role="doc-endnotes">
|
1078
|
+
<ol>
|
1079
|
+
<li id="fn:1" role="doc-endnote">
|
1080
|
+
<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>
|
1081
|
+
</li>
|
1082
|
+
<li id="fn:2" role="doc-endnote">
|
1083
|
+
<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>
|
1084
|
+
</li>
|
1085
|
+
</ol>
|
1086
|
+
</div>
|
1063
1087
|
)
|
1064
1088
|
end
|
1065
1089
|
|
@@ -1070,17 +1094,17 @@ Teston
|
|
1070
1094
|
[^1]: footnote text
|
1071
1095
|
" do
|
1072
1096
|
assert_html_output %(
|
1073
|
-
|
1074
|
-
|
1075
|
-
|
1076
|
-
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1081
|
-
|
1082
|
-
|
1083
|
-
|
1097
|
+
<div class="legislative-list-wrapper">
|
1098
|
+
<p>1. some text<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">[footnote 1]</a></sup>:</p>
|
1099
|
+
</div>
|
1100
|
+
|
1101
|
+
<div class="footnotes" role="doc-endnotes">
|
1102
|
+
<ol>
|
1103
|
+
<li id="fn:1" role="doc-endnote">
|
1104
|
+
<p>footnote text <a href="#fnref:1" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
|
1105
|
+
</li>
|
1106
|
+
</ol>
|
1107
|
+
</div>
|
1084
1108
|
)
|
1085
1109
|
end
|
1086
1110
|
|
@@ -1091,15 +1115,15 @@ Teston
|
|
1091
1115
|
[^1]: footnote text
|
1092
1116
|
" do
|
1093
1117
|
assert_html_output %(
|
1094
|
-
<
|
1118
|
+
<div class="legislative-list-wrapper">
|
1119
|
+
<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>
|
1120
|
+
</div>
|
1095
1121
|
|
1096
1122
|
<div class="footnotes" role="doc-endnotes">
|
1097
1123
|
<ol>
|
1098
1124
|
<li id="fn:1" role="doc-endnote">
|
1099
|
-
|
1100
|
-
|
1101
|
-
</p>
|
1102
|
-
</li>
|
1125
|
+
<p>footnote text <a href="#fnref:1" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
|
1126
|
+
</li>
|
1103
1127
|
</ol>
|
1104
1128
|
</div>
|
1105
1129
|
)
|
@@ -1120,32 +1144,28 @@ Teston
|
|
1120
1144
|
*[class]: Testing HTML matching
|
1121
1145
|
" do
|
1122
1146
|
assert_html_output %(
|
1123
|
-
<
|
1124
|
-
<
|
1147
|
+
<div class="legislative-list-wrapper">
|
1148
|
+
<ol class="legislative-list">
|
1149
|
+
<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>
|
1125
1150
|
</li>
|
1126
|
-
|
1151
|
+
<li>2. Item 2<sup id="fnref:2" role="doc-noteref"><a href="#fn:2" class="footnote" rel="footnote">[footnote 2]</a></sup>
|
1127
1152
|
</li>
|
1128
|
-
|
1153
|
+
<li>3. Item 3<sup id="fnref:3" role="doc-noteref"><a href="#fn:3" class="footnote" rel="footnote">[footnote 3]</a></sup>
|
1129
1154
|
</li>
|
1130
|
-
|
1155
|
+
</ol>
|
1156
|
+
</div>
|
1131
1157
|
|
1132
1158
|
<div class="footnotes" role="doc-endnotes">
|
1133
1159
|
<ol>
|
1134
1160
|
<li id="fn:1" role="doc-endnote">
|
1135
|
-
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1139
|
-
|
1140
|
-
|
1141
|
-
|
1142
|
-
|
1143
|
-
</li>
|
1144
|
-
<li id="fn:3" role="doc-endnote">
|
1145
|
-
<p>
|
1146
|
-
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>
|
1147
|
-
</p>
|
1148
|
-
</li>
|
1161
|
+
<p>Footnote definition one <a href="#fnref:1" class="reversefootnote" role="doc-backlink" aria-label="go to where this is referenced">↩</a></p>
|
1162
|
+
</li>
|
1163
|
+
<li id="fn:2" role="doc-endnote">
|
1164
|
+
<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>
|
1165
|
+
</li>
|
1166
|
+
<li id="fn:3" role="doc-endnote">
|
1167
|
+
<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>
|
1168
|
+
</li>
|
1149
1169
|
</ol>
|
1150
1170
|
</div>
|
1151
1171
|
)
|
@@ -1172,9 +1192,11 @@ Teston
|
|
1172
1192
|
assert_html_output %(
|
1173
1193
|
<p>The quick brown fox</p>
|
1174
1194
|
|
1175
|
-
<
|
1176
|
-
<
|
1177
|
-
|
1195
|
+
<div class="legislative-list-wrapper">
|
1196
|
+
<ol class="legislative-list">
|
1197
|
+
<li>1. jumps over the lazy dog</li>
|
1198
|
+
</ol>
|
1199
|
+
</div>
|
1178
1200
|
)
|
1179
1201
|
end
|
1180
1202
|
|
@@ -1182,9 +1204,67 @@ Teston
|
|
1182
1204
|
assert_html_output %(
|
1183
1205
|
<p>This bit of text</p>
|
1184
1206
|
|
1185
|
-
<
|
1186
|
-
<
|
1187
|
-
|
1207
|
+
<div class="legislative-list-wrapper">
|
1208
|
+
<ol class="legislative-list">
|
1209
|
+
<li>1. should be turned into a list</li>
|
1210
|
+
</ol>
|
1211
|
+
</div>
|
1212
|
+
)
|
1213
|
+
end
|
1214
|
+
|
1215
|
+
test_given_govspeak "
|
1216
|
+
$LegislativeList
|
1217
|
+
Welcome to the GOV.UK website
|
1218
|
+
$EndLegislativeList
|
1219
|
+
|
1220
|
+
*[GOV.UK]: The official UK government website
|
1221
|
+
*[website]: A collection of web pages, such as GOV.UK
|
1222
|
+
" do
|
1223
|
+
assert_html_output %(
|
1224
|
+
<div class="legislative-list-wrapper">
|
1225
|
+
<p>Welcome to the <abbr title="The official UK government website">GOV.UK</abbr> <abbr title="A collection of web pages, such as GOV.UK">website</abbr></p>
|
1226
|
+
</div>
|
1227
|
+
)
|
1228
|
+
end
|
1229
|
+
|
1230
|
+
test_given_govspeak "
|
1231
|
+
$LegislativeList
|
1232
|
+
Please email <developer@digital.cabinet-office.GOV.UK>
|
1233
|
+
$EndLegislativeList
|
1234
|
+
|
1235
|
+
*[GOV.UK]: The official UK government website
|
1236
|
+
" do
|
1237
|
+
assert_html_output %(
|
1238
|
+
<div class="legislative-list-wrapper">
|
1239
|
+
<p>Please email <a href="mailto:developer@digital.cabinet-office.GOV.UK">developer@digital.cabinet-office.<abbr title="The official UK government website">GOV.UK</abbr></a></p>
|
1240
|
+
</div>
|
1241
|
+
)
|
1242
|
+
end
|
1243
|
+
|
1244
|
+
test_given_govspeak "
|
1245
|
+
$LegislativeList
|
1246
|
+
Welcome to the GOV.UK[^1]
|
1247
|
+
$EndLegislativeList
|
1248
|
+
|
1249
|
+
[^1]: GOV.UK is the official UK government website
|
1250
|
+
|
1251
|
+
*[GOV.UK]: The official UK government website
|
1252
|
+
*[website]: A collection of web pages, such as GOV.UK
|
1253
|
+
|
1254
|
+
*[GOV.UK]: The official UK government website
|
1255
|
+
" do
|
1256
|
+
assert_html_output %(
|
1257
|
+
<div class="legislative-list-wrapper">
|
1258
|
+
<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>
|
1259
|
+
</div>
|
1260
|
+
|
1261
|
+
<div class="footnotes" role="doc-endnotes">
|
1262
|
+
<ol>
|
1263
|
+
<li id="fn:1" role="doc-endnote">
|
1264
|
+
<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>
|
1265
|
+
</li>
|
1266
|
+
</ol>
|
1267
|
+
</div>
|
1188
1268
|
)
|
1189
1269
|
end
|
1190
1270
|
|
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: 8.
|
4
|
+
version: 8.3.0
|
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: 2023-
|
11
|
+
date: 2023-10-12 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.4.
|
330
|
+
rubygems_version: 3.4.20
|
331
331
|
signing_key:
|
332
332
|
specification_version: 4
|
333
333
|
summary: Markup language for single domain
|