ree_lib 1.0.44 → 1.0.45
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1833caceb1fab8b06725a1a975b37176fe614d2977bec18a0bbcde694bc8c386
|
|
4
|
+
data.tar.gz: d7a55eebaeabce9227d6d5c991bbd55ce2b70e3a2c1857bef588205320d8a911
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ca8d804780cdaed54a20b120bc8054568af74ca303fc2cd4e237944f1d8db6a9f26dd89fcbe31f912f5a3f966d315839267cc76208fe8a76dfbe7834faf3ab3a
|
|
7
|
+
data.tar.gz: 5840f846e9bf90ba3882454d21f9bf2df376319512a30766ba28ac41e72f70d70429dd0c4c69edc5bdf0bf4b45825c451861f46bb5b0cbbced98b58c7d625393
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
ree_lib (1.0.
|
|
4
|
+
ree_lib (1.0.45)
|
|
5
5
|
binding_of_caller (~> 1.0.0)
|
|
6
6
|
i18n (~> 1.12.0)
|
|
7
7
|
loofah (~> 2.18.0)
|
|
@@ -36,8 +36,6 @@ GEM
|
|
|
36
36
|
crass (~> 1.0.2)
|
|
37
37
|
nokogiri (>= 1.5.9)
|
|
38
38
|
msgpack (1.6.0)
|
|
39
|
-
nokogiri (1.14.2-x86_64-darwin)
|
|
40
|
-
racc (~> 1.4)
|
|
41
39
|
nokogiri (1.14.2-x86_64-linux)
|
|
42
40
|
racc (~> 1.4)
|
|
43
41
|
oj (3.13.23)
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
require 'set'
|
|
4
4
|
|
|
5
5
|
class ReeText::PermitScrubber < Loofah::Scrubber
|
|
6
|
+
include Ree::LinkDSL
|
|
7
|
+
|
|
8
|
+
link :unescape_html
|
|
9
|
+
|
|
6
10
|
attr_reader :tags, :attributes, :prune
|
|
7
11
|
|
|
8
12
|
contract Kwargs[
|
|
@@ -11,7 +15,6 @@ class ReeText::PermitScrubber < Loofah::Scrubber
|
|
|
11
15
|
attributes: Set,
|
|
12
16
|
] => Any
|
|
13
17
|
def initialize(prune: false, tags: nil, attributes: nil)
|
|
14
|
-
@unescape_html = ReeText::UnescapeHtml.new
|
|
15
18
|
@prune = prune
|
|
16
19
|
@direction = @prune ? :top_down : :bottom_up
|
|
17
20
|
@tags = tags
|
|
@@ -26,7 +29,7 @@ class ReeText::PermitScrubber < Loofah::Scrubber
|
|
|
26
29
|
|
|
27
30
|
return CONTINUE
|
|
28
31
|
end
|
|
29
|
-
|
|
32
|
+
|
|
30
33
|
return CONTINUE if node.text?
|
|
31
34
|
|
|
32
35
|
unless (node.element? || node.comment?) && allowed_node?(node)
|
|
@@ -37,7 +40,7 @@ class ReeText::PermitScrubber < Loofah::Scrubber
|
|
|
37
40
|
end
|
|
38
41
|
|
|
39
42
|
protected
|
|
40
|
-
|
|
43
|
+
|
|
41
44
|
def allowed_node?(node)
|
|
42
45
|
@tags.include?(node.name)
|
|
43
46
|
end
|
|
@@ -74,8 +77,7 @@ class ReeText::PermitScrubber < Loofah::Scrubber
|
|
|
74
77
|
|
|
75
78
|
if Loofah::HTML5::SafeList::ATTR_VAL_IS_URI.include?(attr_name)
|
|
76
79
|
# this block lifted nearly verbatim from HTML5 sanitization
|
|
77
|
-
val_unescaped =
|
|
78
|
-
.call(attr_node.value)
|
|
80
|
+
val_unescaped = unescape_html(attr_node.value)
|
|
79
81
|
.gsub(Loofah::HTML5::Scrub::CONTROL_CHARACTERS,'')
|
|
80
82
|
.downcase
|
|
81
83
|
|
data/lib/ree_lib/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ree_lib
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.45
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ruslan Gatiyatov
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-04-
|
|
11
|
+
date: 2023-04-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: ree
|