govspeak 10.0.1 → 10.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: de3347bfd5e3aba6d0a7cf2ba84cf597d2eddb62556d14b52e110ea3bbe16cd3
4
- data.tar.gz: 411758a6ca88e78f95f68d3a7dc74caaca36990e38b773ba69b7f9623b4657a2
3
+ metadata.gz: 244ad3768386af3b3e111493610fd0dd3b3ae892a1661da85be36d1c2d135f94
4
+ data.tar.gz: 915d3141f07e1578263645cdba00d39c02f9987ea15133a50bd6bf09b37d0f32
5
5
  SHA512:
6
- metadata.gz: 055607cd4fab072fff74e3d22f5c8fd071db22593da91b38c46d88415e41c153d5916fdd1afc4bbd2912a8d6a06cf32312af22bea5d853a62b39cd7ae7bc7eeb
7
- data.tar.gz: 5886753801ee61e2a3e23261c99d278c7f53279e5e5acf5d0d0f9930570d64ecac55a1a821afc1a3e6ba05f9d6fac5cc87017ab6988d3363258625b8d85f4ee9
6
+ metadata.gz: b493113cc87018ba77ec5238a160758492056b86b5d10e26fa5e9cd95374197769dcdddcf7fb2965bb0b0ca80fde42af7f0daa3435f66483c4a03f7c94123b57
7
+ data.tar.gz: c2880fc10ca8248e274054dde5a741a375e32a58e0ae20b96a8e98f94109d438d1e0d8dd37eaf9c0937fe4139b758999bd1960ff5ea041a5f6ee4de25a36d899
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 10.2.0
4
+
5
+ * Revert 'Add GA4 indexes to attachments that render a details component' ([#389](https://github.com/alphagov/govspeak/pull/389))
6
+
7
+ ## 10.1.0
8
+
9
+ * Allow acronyms/abbreviations in steps ([#387](https://github.com/alphagov/govspeak/pull/387)).
10
+ * Add GA4 indexes to attachments that render a details component ([#385](https://github.com/alphagov/govspeak/pull/385))
11
+
3
12
  ## 10.0.1
4
13
 
5
14
  * Update dependencies
@@ -15,7 +24,7 @@
15
24
 
16
25
  ## 8.8.3
17
26
 
18
- * Update dependencies (actionview < 8.0.2, sanitize < 8, rubocop-govuk = 5.0.7)
27
+ * Update dependencies (actionview < 8.0.2, sanitize < 8, rubocop-govuk = 5.0.7)
19
28
 
20
29
  ## 8.8.2
21
30
 
@@ -1,3 +1,3 @@
1
1
  module Govspeak
2
- VERSION = "10.0.1".freeze
2
+ VERSION = "10.2.0".freeze
3
3
  end
data/lib/govspeak.rb CHANGED
@@ -317,10 +317,19 @@ module Govspeak
317
317
  end
318
318
 
319
319
  extension("numbered list", /^[ \t]*((s\d+\.\s.*(?:\n|$))+)/) do |body|
320
- body.gsub!(/s(\d+)\.\s(.*)(?:\n|$)/) do
321
- "<li>#{Govspeak::Document.new(Regexp.last_match(2).strip, attachments:).to_html}</li>\n"
320
+ li_elements = body.gsub!(/s(\d+)\.\s(.*)(?:\n|$)/).map do
321
+ element = <<~BODY
322
+ <li markdown="1">
323
+ #{Regexp.last_match(2).strip}
324
+ </li>
325
+ BODY
326
+ element.strip
322
327
  end
323
- %(<ol class="steps">\n#{body}</ol>)
328
+ <<~BODY
329
+ <ol class="steps">
330
+ #{li_elements.join("\n ")}
331
+ </ol>
332
+ BODY
324
333
  end
325
334
 
326
335
  def self.devolved_options
@@ -58,13 +58,13 @@ class GovspeakAttachmentLinkTest < Minitest::Test
58
58
 
59
59
  expected_output = <<~TEXT
60
60
  <ol class="steps">
61
- <li>
62
- <p>First item with <span class="gem-c-attachment-link">
61
+ <li>
62
+ <p>First item with <span class="gem-c-attachment-link">
63
63
  <a class="govuk-link" href="http://example.com/attachment.pdf">Attachment Title</a> </span></p>
64
- </li>
65
- <li>
66
- <p>Second item without attachment</p>
67
- </li>
64
+ </li>
65
+ <li>
66
+ <p>Second item without attachment</p>
67
+ </li>
68
68
  </ol>
69
69
  TEXT
70
70
 
@@ -582,21 +582,38 @@ Teston
582
582
  <p>This is a test:</p>
583
583
 
584
584
  <ol class="steps">
585
+ <li>
586
+ <p>This is number 1.</p>
587
+ </li>
588
+ <li>
589
+ <p>This is number 2.</p>
590
+ </li>
591
+ <li>
592
+ <p>This is number 3.</p>
593
+ </li>
594
+ <li>
595
+ <p>This is number 4.</p>
596
+ </li>
597
+ </ol>
598
+ </div>
599
+ )
600
+ end
601
+
602
+ test_given_govspeak "
603
+ s1. This is number 1.
604
+ s2. This is number 2 with an ACRONYM.
605
+
606
+ *[ACRONYM]: This is the acronym explanation" do
607
+ assert_html_output <<~HTML
608
+ <ol class="steps">
585
609
  <li>
586
- <p>This is number 1.</p>
587
- </li>
588
- <li>
589
- <p>This is number 2.</p>
590
- </li>
591
- <li>
592
- <p>This is number 3.</p>
610
+ <p>This is number 1.</p>
593
611
  </li>
594
612
  <li>
595
- <p>This is number 4.</p>
613
+ <p>This is number 2 with an <abbr title="This is the acronym explanation">ACRONYM</abbr>.</p>
596
614
  </li>
597
- </ol>
598
- </div>
599
- )
615
+ </ol>
616
+ HTML
600
617
  end
601
618
 
602
619
  test_given_govspeak "
@@ -841,15 +858,15 @@ Teston
841
858
  " do
842
859
  assert_html_output %(
843
860
  <ol class="steps">
844
- <li>
845
- <p>zippy</p>
846
- </li>
847
- <li>
848
- <p>bungle</p>
849
- </li>
850
- <li>
851
- <p>george</p>
852
- </li>
861
+ <li>
862
+ <p>zippy</p>
863
+ </li>
864
+ <li>
865
+ <p>bungle</p>
866
+ </li>
867
+ <li>
868
+ <p>george</p>
869
+ </li>
853
870
  </ol>)
854
871
  assert_text_output "zippy bungle george"
855
872
  end
@@ -868,12 +885,12 @@ Teston
868
885
  </ul>
869
886
 
870
887
  <ol class="steps">
871
- <li>
872
- <p>step</p>
873
- </li>
874
- <li>
875
- <p>list</p>
876
- </li>
888
+ <li>
889
+ <p>step</p>
890
+ </li>
891
+ <li>
892
+ <p>list</p>
893
+ </li>
877
894
  </ol>)
878
895
  assert_text_output "unordered list step list"
879
896
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govspeak
3
3
  version: !ruby/object:Gem::Version
4
- version: 10.0.1
4
+ version: 10.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-01-29 00:00:00.000000000 Z
10
+ date: 2025-03-06 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: actionview
@@ -349,7 +349,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
349
349
  - !ruby/object:Gem::Version
350
350
  version: '0'
351
351
  requirements: []
352
- rubygems_version: 3.6.3
352
+ rubygems_version: 3.6.5
353
353
  specification_version: 4
354
354
  summary: Markup language for single domain
355
355
  test_files: