govspeak 3.1.1 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 3.2.0
2
+
3
+ * `span` elements are now allowed through the sanitization process.
4
+
1
5
  ## 3.1.1
2
6
 
3
7
  * Fix a bug where address information could get mixed in with preceding paragraph text.
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Govspeak
2
- VERSION = "3.1.1"
2
+ VERSION = "3.2.0"
3
3
  end
@@ -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.1.1
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-08-27 00:00:00.000000000 Z
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: 1973029752197064168
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: 1973029752197064168
196
+ hash: 1030204254121178856
197
197
  requirements: []
198
198
  rubyforge_project:
199
199
  rubygems_version: 1.8.23