govspeak 3.1.0 → 3.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +4 -0
- data/lib/govspeak.rb +1 -1
- data/lib/govspeak/version.rb +1 -1
- data/test/govspeak_test.rb +14 -1
- metadata +4 -4
data/CHANGELOG.md
CHANGED
data/lib/govspeak.rb
CHANGED
@@ -157,7 +157,7 @@ module Govspeak
|
|
157
157
|
wrap_with_div('call-to-action', '$CTA', Govspeak::Document)
|
158
158
|
|
159
159
|
extension('address', surrounded_by("$A")) { |body|
|
160
|
-
%{<div class="address"><div class="adr org fn"><p>\n#{body.sub("\n", "").gsub("\n", "<br />")}\n</p></div></div>\n}
|
160
|
+
%{\n<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
163
|
extension("legislative list", /(?<=\A|\n\n|\r\n\r\n)^\$LegislativeList\s*$(.*?)\$EndLegislativeList/m) do |body|
|
data/lib/govspeak/version.rb
CHANGED
data/test/govspeak_test.rb
CHANGED
@@ -64,7 +64,20 @@ Testcase Cliffs
|
|
64
64
|
Teston
|
65
65
|
0123 456 7890 $A }
|
66
66
|
doc = Govspeak::Document.new(input)
|
67
|
-
assert_equal %{<div class="address"><div class="adr org fn"><p>\n123 Test Street<br />Testcase Cliffs<br />Teston<br />0123 456 7890 \n</p></div></div>\n}, doc.to_html
|
67
|
+
assert_equal %{\n<div class="address"><div class="adr org fn"><p>\n123 Test Street<br />Testcase Cliffs<br />Teston<br />0123 456 7890 \n</p></div></div>\n}, doc.to_html
|
68
|
+
end
|
69
|
+
|
70
|
+
test "address div is separated from paragraph text by a couple of line-breaks" do
|
71
|
+
# else kramdown processes address div as part of paragraph text and escapes HTML
|
72
|
+
input = %{Paragraph1
|
73
|
+
|
74
|
+
$A
|
75
|
+
123 Test Street
|
76
|
+
Testcase Cliffs
|
77
|
+
Teston
|
78
|
+
0123 456 7890 $A}
|
79
|
+
doc = Govspeak::Document.new(input)
|
80
|
+
assert_equal %{<p>Paragraph1</p>\n\n<div class="address"><div class="adr org fn"><p>\n123 Test Street<br />Testcase Cliffs<br />Teston<br />0123 456 7890 \n</p></div></div>\n}, doc.to_html
|
68
81
|
end
|
69
82
|
|
70
83
|
test_given_govspeak("^ I am very informational ^") 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: 3.1.
|
4
|
+
version: 3.1.1
|
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-08-
|
13
|
+
date: 2014-08-27 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: kramdown
|
@@ -184,7 +184,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
184
184
|
version: '0'
|
185
185
|
segments:
|
186
186
|
- 0
|
187
|
-
hash:
|
187
|
+
hash: 1973029752197064168
|
188
188
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
189
189
|
none: false
|
190
190
|
requirements:
|
@@ -193,7 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
193
193
|
version: '0'
|
194
194
|
segments:
|
195
195
|
- 0
|
196
|
-
hash:
|
196
|
+
hash: 1973029752197064168
|
197
197
|
requirements: []
|
198
198
|
rubyforge_project:
|
199
199
|
rubygems_version: 1.8.23
|