govspeak 1.6.1 → 1.6.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,8 @@
1
+ ## 1.6.2
2
+
3
+ * Fix a bug with parsing of `$LegislativeList` and `$PriorityList` with `\r\n`
4
+ line endings.
5
+
1
6
  ## 1.6.1
2
7
 
3
8
  * Fix a bug with parsing of `$LegislativeList` and `$PriorityList` so that they
@@ -160,7 +160,7 @@ module Govspeak
160
160
  %{<div class="address"><div class="adr org fn"><p>\n#{body.sub("\n", "").gsub("\n", "<br />")}\n</p></div></div>\n}
161
161
  }
162
162
 
163
- extension("legislative list", /(?<=\A|\n{2})^\$LegislativeList\s*$(.*?)(?:^\s*$|\Z)/m) do |body|
163
+ extension("legislative list", /(?<=\A|\n\n|\r\n\r\n)^\$LegislativeList\s*$(.*?)(?:^\s*$|\Z)/m) do |body|
164
164
  Govspeak::KramdownOverrides.with_kramdown_ordered_lists_disabled do
165
165
  Kramdown::Document.new(body.strip).to_html.tap do |doc|
166
166
  doc.gsub!('<ul>', '<ol>')
@@ -196,7 +196,7 @@ module Govspeak
196
196
  end
197
197
  end
198
198
 
199
- extension("Priority list", /(?<=\A|\n{2})^\$PriorityList:(\d+)\s*$(.*?)(?:^\s*$|\Z)/m) do |number_to_show, body|
199
+ extension("Priority list", /(?<=\A|\n\n|\r\n\r\n)^\$PriorityList:(\d+)\s*$(.*?)(?:^\s*$|\Z)/m) do |number_to_show, body|
200
200
  number_to_show = number_to_show.to_i
201
201
  tagged = 0
202
202
  Govspeak::Document.new(body.strip).to_html.gsub(/<li>/) do |match|
@@ -1,3 +1,3 @@
1
1
  module Govspeak
2
- VERSION = "1.6.1"
2
+ VERSION = "1.6.2"
3
3
  end
@@ -444,6 +444,16 @@ $CTA
444
444
  }
445
445
  end
446
446
 
447
+ test_given_govspeak "This bit of text\r\n\r\n$LegislativeList\r\n* 1. should be turned into a list" do
448
+ assert_html_output %{
449
+ <p>This bit of text</p>
450
+
451
+ <ol class="legislative-list">
452
+ <li>1. should be turned into a list</li>
453
+ </ol>
454
+ }
455
+ end
456
+
447
457
  test_given_govspeak "
448
458
  Zippy, Bungle and George did not qualify for the tax exemption in s428. They filled in their tax return accordingly.
449
459
  " do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govspeak
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.1
4
+ version: 1.6.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-06-19 00:00:00.000000000 Z
13
+ date: 2014-06-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: kramdown
@@ -182,7 +182,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
182
182
  version: '0'
183
183
  segments:
184
184
  - 0
185
- hash: 4364278234785949725
185
+ hash: 3676938548072228722
186
186
  required_rubygems_version: !ruby/object:Gem::Requirement
187
187
  none: false
188
188
  requirements:
@@ -191,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
191
191
  version: '0'
192
192
  segments:
193
193
  - 0
194
- hash: 4364278234785949725
194
+ hash: 3676938548072228722
195
195
  requirements: []
196
196
  rubyforge_project:
197
197
  rubygems_version: 1.8.23