govspeak 6.5.4 → 6.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Rakefile +6 -3
- data/lib/govspeak.rb +51 -51
- data/lib/govspeak/html_sanitizer.rb +3 -3
- data/lib/govspeak/kramdown_overrides.rb +2 -2
- data/lib/govspeak/link_extractor.rb +3 -3
- data/lib/govspeak/post_processor.rb +7 -5
- data/lib/govspeak/presenters/attachment_presenter.rb +26 -26
- data/lib/govspeak/presenters/image_presenter.rb +2 -2
- data/lib/govspeak/structured_header_extractor.rb +2 -2
- data/lib/govspeak/version.rb +1 -1
- data/lib/kramdown/parser/govuk.rb +5 -6
- data/test/blockquote_extra_quote_remover_test.rb +24 -26
- data/test/govspeak_attachment_link_test.rb +0 -2
- data/test/govspeak_attachment_test.rb +0 -2
- data/test/govspeak_attachments_image_test.rb +2 -4
- data/test/govspeak_attachments_inline_test.rb +4 -6
- data/test/govspeak_button_test.rb +8 -10
- data/test/govspeak_contacts_test.rb +11 -13
- data/test/govspeak_extract_contact_content_ids_test.rb +0 -2
- data/test/govspeak_images_bang_test.rb +30 -32
- data/test/govspeak_images_test.rb +36 -38
- data/test/govspeak_link_extractor_test.rb +1 -1
- data/test/govspeak_link_test.rb +0 -2
- data/test/govspeak_structured_headers_test.rb +5 -4
- data/test/govspeak_table_with_headers_test.rb +67 -20
- data/test/govspeak_test.rb +80 -83
- data/test/govspeak_test_helper.rb +1 -1
- data/test/html_sanitizer_test.rb +0 -1
- data/test/presenters/h_card_presenter_test.rb +0 -2
- data/test/test_helper.rb +6 -2
- metadata +17 -17
@@ -49,7 +49,7 @@ module GovspeakTestHelper
|
|
49
49
|
lines = text.split "\n"
|
50
50
|
digits = Math.log10(lines.size + 2).ceil
|
51
51
|
lines.map
|
52
|
-
.with_index { |line, i| "%<number>#{digits}d: %<line>s"
|
52
|
+
.with_index { |line, i| sprintf("%<number>#{digits}d: %<line>s", number: i + 1, line: line) }
|
53
53
|
.join("\n")
|
54
54
|
end
|
55
55
|
end
|
data/test/html_sanitizer_test.rb
CHANGED
@@ -79,7 +79,6 @@ class HtmlSanitizerTest < Minitest::Test
|
|
79
79
|
assert_equal "<table><tbody><tr><th>thing</th><td>thing</td></tr></tbody></table>", Govspeak::HtmlSanitizer.new(html).sanitize
|
80
80
|
end
|
81
81
|
|
82
|
-
|
83
82
|
test "allows valid text-align properties on the style attribute for table cells and table headings" do
|
84
83
|
%w[left right center].each do |alignment|
|
85
84
|
html = "<table><thead><tr><th style=\"text-align: #{alignment}\">thing</th></tr></thead><tbody><tr><td style=\"text-align: #{alignment}\">thing</td></tr></tbody></table>"
|
data/test/test_helper.rb
CHANGED
@@ -4,7 +4,7 @@ require "simplecov-rcov"
|
|
4
4
|
SimpleCov.start
|
5
5
|
SimpleCov.formatter = SimpleCov::Formatter::RcovFormatter
|
6
6
|
|
7
|
-
|
7
|
+
$LOAD_PATH.unshift(File.expand_path("../lib")) unless $LOAD_PATH.include?(File.expand_path("../lib"))
|
8
8
|
|
9
9
|
require "bundler"
|
10
10
|
Bundler.setup :default, :development, :test
|
@@ -16,7 +16,11 @@ class Minitest::Test
|
|
16
16
|
def test(name, &block)
|
17
17
|
clean_name = name.gsub(/\s+/, "_")
|
18
18
|
method = "test_#{clean_name.gsub(/\s+/, '_')}".to_sym
|
19
|
-
already_defined =
|
19
|
+
already_defined = begin
|
20
|
+
instance_method(method)
|
21
|
+
rescue StandardError
|
22
|
+
false
|
23
|
+
end
|
20
24
|
raise "#{method} exists" if already_defined
|
21
25
|
|
22
26
|
define_method(method, &block)
|
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.5.
|
4
|
+
version: 6.5.5
|
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: 2020-
|
11
|
+
date: 2020-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionview
|
@@ -174,14 +174,14 @@ dependencies:
|
|
174
174
|
requirements:
|
175
175
|
- - "~>"
|
176
176
|
- !ruby/object:Gem::Version
|
177
|
-
version: 5.
|
177
|
+
version: 5.14.1
|
178
178
|
type: :development
|
179
179
|
prerelease: false
|
180
180
|
version_requirements: !ruby/object:Gem::Requirement
|
181
181
|
requirements:
|
182
182
|
- - "~>"
|
183
183
|
- !ruby/object:Gem::Version
|
184
|
-
version: 5.
|
184
|
+
version: 5.14.1
|
185
185
|
- !ruby/object:Gem::Dependency
|
186
186
|
name: pry-byebug
|
187
187
|
requirement: !ruby/object:Gem::Requirement
|
@@ -371,23 +371,23 @@ signing_key:
|
|
371
371
|
specification_version: 4
|
372
372
|
summary: Markup language for single domain
|
373
373
|
test_files:
|
374
|
+
- test/blockquote_extra_quote_remover_test.rb
|
375
|
+
- test/govspeak_test_helper.rb
|
376
|
+
- test/govspeak_structured_headers_test.rb
|
374
377
|
- test/govspeak_attachment_link_test.rb
|
378
|
+
- test/govspeak_attachments_image_test.rb
|
375
379
|
- test/test_helper.rb
|
380
|
+
- test/govspeak_attachments_inline_test.rb
|
381
|
+
- test/html_sanitizer_test.rb
|
376
382
|
- test/govspeak_button_test.rb
|
377
|
-
- test/
|
383
|
+
- test/govspeak_images_bang_test.rb
|
384
|
+
- test/govspeak_images_test.rb
|
378
385
|
- test/html_validator_test.rb
|
379
386
|
- test/govspeak_attachment_test.rb
|
380
|
-
- test/govspeak_contacts_test.rb
|
381
|
-
- test/govspeak_test_helper.rb
|
382
|
-
- test/blockquote_extra_quote_remover_test.rb
|
383
|
-
- test/govspeak_table_with_headers_test.rb
|
384
|
-
- test/govspeak_attachments_image_test.rb
|
385
|
-
- test/html_sanitizer_test.rb
|
386
|
-
- test/govspeak_link_test.rb
|
387
387
|
- test/govspeak_extract_contact_content_ids_test.rb
|
388
|
-
- test/
|
389
|
-
- test/govspeak_images_test.rb
|
390
|
-
- test/presenters/h_card_presenter_test.rb
|
391
|
-
- test/govspeak_images_bang_test.rb
|
388
|
+
- test/govspeak_test.rb
|
392
389
|
- test/govspeak_link_extractor_test.rb
|
393
|
-
- test/
|
390
|
+
- test/govspeak_link_test.rb
|
391
|
+
- test/govspeak_contacts_test.rb
|
392
|
+
- test/presenters/h_card_presenter_test.rb
|
393
|
+
- test/govspeak_table_with_headers_test.rb
|