string_tools 1.1.0 → 1.3.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +42 -1
- data/lib/string_tools/version.rb +1 -1
- data/lib/string_tools.rb +9 -2
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 518b671cee6921170a923aec262e1da3552c586c87540db9d8ab232e90104eb1
|
|
4
|
+
data.tar.gz: 573cf234c034abf50ecc23c7ae016a0aafd63038c8b0af589a04e54b6077ddf3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 667b2621aadf33fd77f3b1d003105adb982959cfc30d5694626480e52704c68e87bf9c0171ec6d0fa44eb353966de1ea78e053d1c2ac6c4e2bc2705baadd41c5
|
|
7
|
+
data.tar.gz: 8f5f2d10969a4b30f80ec931f7f2451653e3437e7400caff6bc58621535af396eed2049532abd6f3c30e9a08927b4ef3e47b8adfb11456431e7d0706b216f289
|
data/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,22 @@
|
|
|
1
|
-
# v1.
|
|
1
|
+
# v1.3.0
|
|
2
|
+
|
|
3
|
+
* 2024-11-15 [771ba6b](../../commit/771ba6b) - __(git3-railsc)__ Release 1.3.0
|
|
4
|
+
* 2024-09-20 [cba6db7](../../commit/cba6db7) - __(bayerd412)__ feat(ck-editor video hosting): add rutube
|
|
5
|
+
https://jira.railsc.ru/browse/PC4-31420
|
|
6
|
+
|
|
7
|
+
* 2024-04-08 [be7e7fd](../../commit/be7e7fd) - __(Andrew N. Shalaev)__ Release v1.2.0
|
|
8
|
+
* 2023-11-29 [393bb13](../../commit/393bb13) - __(GIGrave)__ feature: add media to sanitize rules
|
|
9
|
+
https://jira.railsc.ru/browse/BPC-22916
|
|
10
|
+
|
|
11
|
+
* 2023-11-29 [06eb51e](../../commit/06eb51e) - __(GIGrave)__ Revert "feature: add string_tools config"
|
|
12
|
+
This reverts commit c0b9bf39ec3cf2fce28fe92c7892a0c47593ca09.
|
|
13
|
+
|
|
14
|
+
* 2023-11-29 [d1c00b9](../../commit/d1c00b9) - __(GIGrave)__ Revert "fix: add postgress to drone"
|
|
15
|
+
This reverts commit 33e5698fd48d5edf416df316e3466f9e6c58369f.
|
|
16
|
+
|
|
17
|
+
* 2023-11-02 [33e5698](../../commit/33e5698) - __(GIGrave)__ fix: add postgress to drone
|
|
18
|
+
* 2023-11-02 [c0b9bf3](../../commit/c0b9bf3) - __(GIGrave)__ feature: add string_tools config
|
|
19
|
+
https://jira.railsc.ru/browse/BPC-22612
|
|
2
20
|
|
|
3
21
|
* 2023-10-16 [8ccb54a](../../commit/8ccb54a) - __(ArtemBorodinEvgenyevich)__ Release v1.1.0
|
|
4
22
|
* 2023-08-29 [bed389b](../../commit/bed389b) - __(Terentev Aleksey)__ feat: sanitize links in alt of img tag
|
|
@@ -103,6 +121,29 @@ https://jira.railsc.ru/browse/PC4-16353
|
|
|
103
121
|
# v3.0.1
|
|
104
122
|
|
|
105
123
|
|
|
124
|
+
# v1.2.0
|
|
125
|
+
|
|
126
|
+
* 2023-11-29 [393bb13](../../commit/393bb13) - __(GIGrave)__ feature: add media to sanitize rules
|
|
127
|
+
https://jira.railsc.ru/browse/BPC-22916
|
|
128
|
+
|
|
129
|
+
* 2023-11-29 [06eb51e](../../commit/06eb51e) - __(GIGrave)__ Revert "feature: add string_tools config"
|
|
130
|
+
This reverts commit c0b9bf39ec3cf2fce28fe92c7892a0c47593ca09.
|
|
131
|
+
|
|
132
|
+
* 2023-11-29 [d1c00b9](../../commit/d1c00b9) - __(GIGrave)__ Revert "fix: add postgress to drone"
|
|
133
|
+
This reverts commit 33e5698fd48d5edf416df316e3466f9e6c58369f.
|
|
134
|
+
|
|
135
|
+
* 2023-11-02 [33e5698](../../commit/33e5698) - __(GIGrave)__ fix: add postgress to drone
|
|
136
|
+
* 2023-11-02 [c0b9bf3](../../commit/c0b9bf3) - __(GIGrave)__ feature: add string_tools config
|
|
137
|
+
https://jira.railsc.ru/browse/BPC-22612
|
|
138
|
+
|
|
139
|
+
# v1.1.0
|
|
140
|
+
|
|
141
|
+
* 2023-08-29 [bed389b](../../commit/bed389b) - __(Terentev Aleksey)__ feat: sanitize links in alt of img tag
|
|
142
|
+
https://jira.railsc.ru/browse/PC4-29908
|
|
143
|
+
|
|
144
|
+
* 2023-08-11 [7848491](../../commit/7848491) - __(Terentev Aleksey)__ feat: add options for sanitize outer links in css
|
|
145
|
+
https://jira.railsc.ru/browse/PC4-29908
|
|
146
|
+
|
|
106
147
|
# v1.0.0
|
|
107
148
|
|
|
108
149
|
* 2023-06-15 [8e9fa48](../../commit/8e9fa48) - __(Andrew N. Shalaev)__ fix: convert to_utf8 correctly, without hidding errors
|
data/lib/string_tools/version.rb
CHANGED
data/lib/string_tools.rb
CHANGED
|
@@ -181,7 +181,11 @@ module StringTools
|
|
|
181
181
|
str,
|
|
182
182
|
:attributes => attributes,
|
|
183
183
|
:elements => elements,
|
|
184
|
-
:css => {
|
|
184
|
+
:css => {
|
|
185
|
+
at_rules_with_styles: ['media'],
|
|
186
|
+
properties: Sanitize::Config::RELAXED[:css][:properties],
|
|
187
|
+
protocols: protocols,
|
|
188
|
+
},
|
|
185
189
|
:remove_contents => remove_contents || Set['style', 'script'],
|
|
186
190
|
:allow_comments => false,
|
|
187
191
|
:transformers => transformers
|
|
@@ -222,6 +226,9 @@ module StringTools
|
|
|
222
226
|
end
|
|
223
227
|
|
|
224
228
|
class IframeNormalizer
|
|
229
|
+
HOSTING_REG = %r{^https?:\/\/(www\.)?(?:(rutube\.ru\/(video|play|embed))|
|
|
230
|
+
(youtu((?:be|\.be|be\-nocookie)(?:\/|\.com\/(watch|shorts|embed)))))}x.freeze
|
|
231
|
+
|
|
225
232
|
def initialize(attributes)
|
|
226
233
|
@attributes = attributes
|
|
227
234
|
end
|
|
@@ -231,7 +238,7 @@ module StringTools
|
|
|
231
238
|
|
|
232
239
|
return unless node.name == 'iframe'
|
|
233
240
|
|
|
234
|
-
unless node[:src] =~
|
|
241
|
+
unless node[:src] =~ HOSTING_REG
|
|
235
242
|
node.unlink
|
|
236
243
|
return
|
|
237
244
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: string_tools
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sergey D.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2024-11-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: actionpack
|