govspeak 3.1.1 → 3.2.0
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/html_sanitizer.rb +1 -1
- data/lib/govspeak/version.rb +1 -1
- data/test/html_validator_test.rb +5 -0
- metadata +4 -4
data/CHANGELOG.md
CHANGED
@@ -45,7 +45,7 @@ class Govspeak::HtmlSanitizer
|
|
45
45
|
:all => Sanitize::Config::RELAXED[:attributes][:all] + [ "id", "class" ],
|
46
46
|
"a" => Sanitize::Config::RELAXED[:attributes]["a"] + [ "rel" ],
|
47
47
|
},
|
48
|
-
elements: Sanitize::Config::RELAXED[:elements] + [ "div" ],
|
48
|
+
elements: Sanitize::Config::RELAXED[:elements] + [ "div", "span" ],
|
49
49
|
})
|
50
50
|
end
|
51
51
|
end
|
data/lib/govspeak/version.rb
CHANGED
data/test/html_validator_test.rb
CHANGED
@@ -90,4 +90,9 @@ class HtmlValidatorTest < Test::Unit::TestCase
|
|
90
90
|
html = "<img src='http://evil.com/image.jgp'>"
|
91
91
|
assert Govspeak::HtmlValidator.new(html, allowed_image_hosts: ['allowed.com']).invalid?
|
92
92
|
end
|
93
|
+
|
94
|
+
test "allow <div> and <span> HTML elements" do
|
95
|
+
html = "<div class=\"govspeak\"><h2 id=\"some-title\">\n<span class=\"number\">1. </span> Some title</h2>\n\n<p>Some text</p>\n</div>"
|
96
|
+
assert Govspeak::HtmlValidator.new(html).valid?
|
97
|
+
end
|
93
98
|
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: 3.
|
4
|
+
version: 3.2.0
|
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-10-03 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: 1030204254121178856
|
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: 1030204254121178856
|
197
197
|
requirements: []
|
198
198
|
rubyforge_project:
|
199
199
|
rubygems_version: 1.8.23
|