rails-html-sanitizer 1.6.0.rc1 → 1.6.0.rc2
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -2
- data/lib/rails/html/sanitizer/version.rb +1 -1
- data/lib/rails/html/sanitizer.rb +4 -0
- data/test/rails_api_test.rb +14 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ce8562c96b3e842ebf50227e682c3fa948ebf8474786f100dbf78adff7f98d0
|
4
|
+
data.tar.gz: 7ca7beb76be35dea0dd926819212445e885a2b205ca0b2e45628f58d734a1a9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30d9b9288698da75f713811e8b507edda0645eb4a485b0466847a4b8246aa854cd12e4dae238e61b09e371c950ee8516595b39207d4b10323bf81cf74b0a5114
|
7
|
+
data.tar.gz: 81698f017c423bac3434e7129b70c4ecba80b27a4f8c6d86294d548aeeb9238d98cd65c15f06bcf62c6ee104e8b3beca782c8e9b338302590c33b65ab9ed8121
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
## 1.6.0.
|
1
|
+
## 1.6.0.rc2 / 2023-05-24
|
2
2
|
|
3
|
-
*
|
3
|
+
* HTML5 standards-compliant sanitizers are now available on platforms supported by
|
4
4
|
Nokogiri::HTML5. These are available as:
|
5
5
|
|
6
6
|
- `Rails::HTML5::FullSanitizer`
|
@@ -13,6 +13,9 @@
|
|
13
13
|
Note that for symmetry `Rails::HTML4::Sanitizer` is also added, though its behavior is identical
|
14
14
|
to the vendor class methods on `Rails::HTML::Sanitizer`.
|
15
15
|
|
16
|
+
Users may call `Rails::HTML::Sanitizer.best_supported_vendor` to get back the HTML5 vendor if it's
|
17
|
+
supported, else the legacy HTML4 vendor.
|
18
|
+
|
16
19
|
*Mike Dalessio*
|
17
20
|
|
18
21
|
* Module namespaces have changed, but backwards compatibility is provided by aliases.
|
data/lib/rails/html/sanitizer.rb
CHANGED
data/test/rails_api_test.rb
CHANGED
@@ -17,6 +17,20 @@ class RailsApiTest < Minitest::Test
|
|
17
17
|
assert(Rails::Html::Sanitizer)
|
18
18
|
end
|
19
19
|
|
20
|
+
def test_best_supported_vendor_when_html5_is_not_supported_returns_html4
|
21
|
+
Rails::HTML::Sanitizer.stub(:html5_support?, false) do
|
22
|
+
assert_equal(Rails::HTML4::Sanitizer, Rails::HTML::Sanitizer.best_supported_vendor)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_best_supported_vendor_when_html5_is_supported_returns_html5
|
27
|
+
skip("no HTML5 support on this platform") unless Rails::HTML::Sanitizer.html5_support?
|
28
|
+
|
29
|
+
Rails::HTML::Sanitizer.stub(:html5_support?, true) do
|
30
|
+
assert_equal(Rails::HTML5::Sanitizer, Rails::HTML::Sanitizer.best_supported_vendor)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
20
34
|
def test_html4_sanitizer_alias_full
|
21
35
|
assert_equal(Rails::HTML4::FullSanitizer, Rails::HTML::FullSanitizer)
|
22
36
|
assert_equal("Rails::HTML4::FullSanitizer", Rails::HTML::FullSanitizer.name)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-html-sanitizer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.0.
|
4
|
+
version: 1.6.0.rc2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rafael Mendonça França
|
@@ -64,9 +64,9 @@ licenses:
|
|
64
64
|
- MIT
|
65
65
|
metadata:
|
66
66
|
bug_tracker_uri: https://github.com/rails/rails-html-sanitizer/issues
|
67
|
-
changelog_uri: https://github.com/rails/rails-html-sanitizer/blob/v1.6.0.
|
68
|
-
documentation_uri: https://www.rubydoc.info/gems/rails-html-sanitizer/1.6.0.
|
69
|
-
source_code_uri: https://github.com/rails/rails-html-sanitizer/tree/v1.6.0.
|
67
|
+
changelog_uri: https://github.com/rails/rails-html-sanitizer/blob/v1.6.0.rc2/CHANGELOG.md
|
68
|
+
documentation_uri: https://www.rubydoc.info/gems/rails-html-sanitizer/1.6.0.rc2
|
69
|
+
source_code_uri: https://github.com/rails/rails-html-sanitizer/tree/v1.6.0.rc2
|
70
70
|
post_install_message:
|
71
71
|
rdoc_options: []
|
72
72
|
require_paths:
|