govspeak 1.5.2 → 1.5.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +5 -0
- data/lib/govspeak.rb +7 -7
- data/lib/govspeak/version.rb +1 -1
- data/test/govspeak_test.rb +1 -1
- metadata +4 -4
data/CHANGELOG.md
CHANGED
data/lib/govspeak.rb
CHANGED
@@ -96,7 +96,7 @@ module Govspeak
|
|
96
96
|
}
|
97
97
|
end
|
98
98
|
|
99
|
-
def insert_strong_inside_p(body, parser=
|
99
|
+
def insert_strong_inside_p(body, parser=Govspeak::Document)
|
100
100
|
parser.new(body.strip).to_html.sub(/^<p>(.*)<\/p>$/,"<p><strong>\\1</strong></p>")
|
101
101
|
end
|
102
102
|
|
@@ -106,7 +106,7 @@ module Govspeak
|
|
106
106
|
|
107
107
|
extension('highlight-answer') { |body|
|
108
108
|
%{\n\n<div class="highlight-answer">
|
109
|
-
#{
|
109
|
+
#{Govspeak::Document.new(body.strip).to_html}</div>\n}
|
110
110
|
}
|
111
111
|
|
112
112
|
# FIXME: these surrounded_by arguments look dodgy
|
@@ -116,7 +116,7 @@ module Govspeak
|
|
116
116
|
|
117
117
|
extension('informational', surrounded_by("^")) { |body|
|
118
118
|
%{\n\n<div class="application-notice info-notice">
|
119
|
-
#{
|
119
|
+
#{Govspeak::Document.new(body.strip).to_html}</div>\n}
|
120
120
|
}
|
121
121
|
|
122
122
|
extension('important', surrounded_by("@")) { |body|
|
@@ -124,7 +124,7 @@ module Govspeak
|
|
124
124
|
}
|
125
125
|
|
126
126
|
extension('helpful', surrounded_by("%")) { |body|
|
127
|
-
%{\n\n<div class="application-notice help-notice">\n#{
|
127
|
+
%{\n\n<div class="application-notice help-notice">\n#{Govspeak::Document.new(body.strip).to_html}</div>\n}
|
128
128
|
}
|
129
129
|
|
130
130
|
extension('attached-image', /^!!([0-9]+)/) do |image_number|
|
@@ -162,7 +162,7 @@ module Govspeak
|
|
162
162
|
extension("numbered list", /^\s*((s\d+\.\s.*(?:\n|$))+)/) do |body|
|
163
163
|
steps ||= 0
|
164
164
|
body.gsub!(/s(\d+)\.\s(.*)(?:\n|$)/) do |b|
|
165
|
-
"<li>#{
|
165
|
+
"<li>#{Govspeak::Document.new($2.strip).to_html}</li>\n"
|
166
166
|
end
|
167
167
|
%{<ol class="steps">\n#{body}</ol>}
|
168
168
|
end
|
@@ -180,7 +180,7 @@ module Govspeak
|
|
180
180
|
extension("devolved-#{k}",/:#{k}:(.*?):#{k}:/m) do |body|
|
181
181
|
%{<div class="devolved-content #{k}">
|
182
182
|
<p class="devolved-header">This section applies to #{v}</p>
|
183
|
-
<div class="devolved-body">#{
|
183
|
+
<div class="devolved-body">#{Govspeak::Document.new(body.strip).to_html}</div>
|
184
184
|
</div>\n}
|
185
185
|
end
|
186
186
|
end
|
@@ -188,7 +188,7 @@ module Govspeak
|
|
188
188
|
extension("Priority list", /\$PriorityList:(\d+)\s*$(.*?)(?:^\s*$|\Z)/m) do |number_to_show, body|
|
189
189
|
number_to_show = number_to_show.to_i
|
190
190
|
tagged = 0
|
191
|
-
|
191
|
+
Govspeak::Document.new(body.strip).to_html.gsub(/<li>/) do |match|
|
192
192
|
if tagged < number_to_show
|
193
193
|
tagged += 1
|
194
194
|
'<li class="primary-item">'
|
data/lib/govspeak/version.rb
CHANGED
data/test/govspeak_test.rb
CHANGED
@@ -395,7 +395,7 @@ $CTA
|
|
395
395
|
|
396
396
|
test_given_govspeak "@ Message with [a link](http://foo.bar/)@" do
|
397
397
|
assert_html_output %{
|
398
|
-
<div class="advisory"><p><strong>Message with <a href="http://foo.bar/">a link</a></strong></p>
|
398
|
+
<div class="advisory"><p><strong>Message with <a rel="external" href="http://foo.bar/">a link</a></strong></p>
|
399
399
|
</div>
|
400
400
|
}
|
401
401
|
end
|
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.5.
|
4
|
+
version: 1.5.3
|
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-
|
13
|
+
date: 2014-06-09 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: kramdown
|
@@ -181,7 +181,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
181
181
|
version: '0'
|
182
182
|
segments:
|
183
183
|
- 0
|
184
|
-
hash:
|
184
|
+
hash: 3341378448441504199
|
185
185
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
186
186
|
none: false
|
187
187
|
requirements:
|
@@ -190,7 +190,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
190
190
|
version: '0'
|
191
191
|
segments:
|
192
192
|
- 0
|
193
|
-
hash:
|
193
|
+
hash: 3341378448441504199
|
194
194
|
requirements: []
|
195
195
|
rubyforge_project:
|
196
196
|
rubygems_version: 1.8.23
|