mumukit-content-type 1.5.1 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mumukit/content_type/sanitizer.rb +6 -2
- data/lib/mumukit/content_type/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 327af1f4750e66270d5448bd48af28bd7dd96e1b962d9c1ce34de32f58b348ec
|
4
|
+
data.tar.gz: 3682f164134dd03b871167b6722cedc3f20abf8e7784566c508e7835f55a3ccb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43b2562fa89d3b5a4a5bbaa60a67aa129709d9617972022834317abdede19725181ba62697edab8746c6aafe0ebaac1c550d6511d9856cbc2092863665b314d3
|
7
|
+
data.tar.gz: df6681d4115bfe75e5dab267cecd77becaab075b2ca7ab101ecb561bb5066186730e18998cd23bbce650df76f2644cb97addd2395d318e726db369ceb99ac152
|
@@ -2,7 +2,7 @@ require 'sanitize'
|
|
2
2
|
|
3
3
|
module Mumukit::ContentType::Sanitizer
|
4
4
|
class << self
|
5
|
-
class_attribute :should_sanitize, :allowed_elements, :allowed_attributes
|
5
|
+
class_attribute :should_sanitize, :allowed_elements, :allowed_attributes, :transformers
|
6
6
|
|
7
7
|
self.should_sanitize = false
|
8
8
|
self.allowed_elements = []
|
@@ -10,6 +10,8 @@ module Mumukit::ContentType::Sanitizer
|
|
10
10
|
'a' => Sanitize::Config::RELAXED[:attributes]['a'] + ['target']
|
11
11
|
}
|
12
12
|
|
13
|
+
self.transformers = []
|
14
|
+
|
13
15
|
def sanitize(html)
|
14
16
|
return html unless should_sanitize?
|
15
17
|
|
@@ -20,10 +22,12 @@ module Mumukit::ContentType::Sanitizer
|
|
20
22
|
Sanitize::Config.merge(Sanitize::Config::RELAXED, custom_sanitization_settings)
|
21
23
|
end
|
22
24
|
|
25
|
+
|
23
26
|
def custom_sanitization_settings
|
24
27
|
{
|
25
28
|
elements: Sanitize::Config::RELAXED[:elements] + allowed_elements,
|
26
|
-
attributes: allowed_attributes
|
29
|
+
attributes: allowed_attributes,
|
30
|
+
transformers: transformers
|
27
31
|
}
|
28
32
|
end
|
29
33
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mumukit-content-type
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Franco Leonardo Bulgarelli
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-05-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -1040,8 +1040,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1040
1040
|
- !ruby/object:Gem::Version
|
1041
1041
|
version: '0'
|
1042
1042
|
requirements: []
|
1043
|
-
|
1044
|
-
rubygems_version: 2.7.8
|
1043
|
+
rubygems_version: 3.0.3
|
1045
1044
|
signing_key:
|
1046
1045
|
specification_version: 4
|
1047
1046
|
summary: Content Type handling for Mumuki
|