govspeak 6.8.3 → 6.8.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ca0f29b1dceee03154a3f7f535e27c5bf7ebf5ae5e42845919c7bfea3eb2e132
4
- data.tar.gz: 428ff21aa80eaccd670ee643aed80d3081148417161f1a1bf10b78742e01c6b4
3
+ metadata.gz: 35ed6a74578a19fb89e4c855494d27708d7809e925a6029b5b391fbe474f5d49
4
+ data.tar.gz: 74f0b44824ff948767ae8e8f1a5f95ae784f07ea3ab424f66a46ee0d07efb6af
5
5
  SHA512:
6
- metadata.gz: cef697b4026db708378ede49588032d2b95e603a4f4ce87053b8c47ce119ff94b6ad5363e4ec7079d914941c48db0fb6d93ed3b75fff1225459957ed3d24736a
7
- data.tar.gz: e78af326c264e4d4d92dedebb23a8db4a08927e55101f435a4ebe4714142e5432262bf1b1ce45553e83f6bb969af859ee4bcba7388a62fc63c987cc83f86ad99
6
+ metadata.gz: c022e6a898d40e41ea571d9f39863f6235822810d2823f99d17e58eb559ab7e0b2b35c2a60cdec627270b9fe3d31c39224f820e5e8f3378f8df811478ca6203d
7
+ data.tar.gz: facb052f32abfcdc7e54fb6799d7e052d1a951aedce6db6b582fa716654bb6cc6730ff99af65a2af511dc0039b4f07f8f9669accbadf8821b01f2280c22933c8
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 6.8.4
2
+
3
+ * Fix bug where inconsistent linebreaks trigger validations [#250](https://github.com/alphagov/govspeak/pull/250)
4
+
1
5
  ## 6.8.3
2
6
 
3
7
  * Require Kramdown minimum version of 2.3.1 to avoid CVE-2021-28834 [#246](https://github.com/alphagov/govspeak/pull/246)
@@ -20,7 +20,7 @@ private
20
20
 
21
21
  # Make whitespace in html tags consistent
22
22
  def normalise_html(html)
23
- Nokogiri::HTML5.fragment(html).to_s
23
+ Nokogiri::HTML5.fragment(html).to_s.gsub("\n", "")
24
24
  end
25
25
 
26
26
  def govspeak_to_html(sanitize:)
@@ -1,3 +1,3 @@
1
1
  module Govspeak
2
- VERSION = "6.8.3".freeze
2
+ VERSION = "6.8.4".freeze
3
3
  end
@@ -108,4 +108,9 @@ class HtmlValidatorTest < Minitest::Test
108
108
  assert Govspeak::HtmlValidator.new("<table><tr><td>Hello</td></tr></table>").valid?, "No <tbody> is valid"
109
109
  assert Govspeak::HtmlValidator.new("<table><tbody><tr><td>Hello</td></tr></tbody></table>").valid?, "<tbody> is valid"
110
110
  end
111
+
112
+ test "allow HTML tables with \n" do
113
+ html = "<table>\n<thead>\n<tr>\n<th></th>\n<th></th>\n<th colspan=\"3\"></th>\n\n</tr>\n</thead>\n<tr>\n<th></th>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n</table>"
114
+ assert Govspeak::HtmlValidator.new(html).valid?, 'Tables with no <tbody> and \n are valid'
115
+ end
111
116
  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.8.3
4
+ version: 6.8.4
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-06-21 00:00:00.000000000 Z
11
+ date: 2022-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionview
@@ -190,14 +190,14 @@ dependencies:
190
190
  requirements:
191
191
  - - '='
192
192
  - !ruby/object:Gem::Version
193
- version: 4.5.0
193
+ version: 4.6.0
194
194
  type: :development
195
195
  prerelease: false
196
196
  version_requirements: !ruby/object:Gem::Requirement
197
197
  requirements:
198
198
  - - '='
199
199
  - !ruby/object:Gem::Version
200
- version: 4.5.0
200
+ version: 4.6.0
201
201
  - !ruby/object:Gem::Dependency
202
202
  name: simplecov
203
203
  requirement: !ruby/object:Gem::Requirement
@@ -327,29 +327,29 @@ 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.16
330
+ rubygems_version: 3.3.20
331
331
  signing_key:
332
332
  specification_version: 4
333
333
  summary: Markup language for single domain
334
334
  test_files:
335
- - test/govspeak_attachment_link_test.rb
336
- - test/test_helper.rb
337
- - test/govspeak_button_test.rb
338
- - test/govspeak_footnote_test.rb
339
- - test/govspeak_images_test.rb
340
- - test/govspeak_images_bang_test.rb
341
- - test/blockquote_extra_quote_remover_test.rb
342
- - test/html_sanitizer_test.rb
335
+ - test/govspeak_attachments_image_test.rb
336
+ - test/govspeak_link_extractor_test.rb
343
337
  - test/govspeak_table_with_headers_test.rb
338
+ - test/govspeak_attachment_test.rb
344
339
  - test/govspeak_extract_contact_content_ids_test.rb
340
+ - test/test_helper.rb
345
341
  - test/html_validator_test.rb
346
- - test/govspeak_contacts_test.rb
342
+ - test/govspeak_test_helper.rb
343
+ - test/html_sanitizer_test.rb
344
+ - test/govspeak_footnote_test.rb
345
+ - test/govspeak_images_test.rb
346
+ - test/govspeak_button_test.rb
347
347
  - test/govspeak_test.rb
348
- - test/govspeak_attachments_image_test.rb
349
- - test/govspeak_attachment_test.rb
350
- - test/govspeak_link_extractor_test.rb
351
- - test/govspeak_link_test.rb
348
+ - test/blockquote_extra_quote_remover_test.rb
349
+ - test/govspeak_images_bang_test.rb
352
350
  - test/presenters/h_card_presenter_test.rb
351
+ - test/govspeak_contacts_test.rb
352
+ - test/govspeak_attachment_link_test.rb
353
353
  - test/govspeak_attachments_inline_test.rb
354
- - test/govspeak_test_helper.rb
354
+ - test/govspeak_link_test.rb
355
355
  - test/govspeak_structured_headers_test.rb