@@ -2,9 +2,9 @@ module Rails
2
2
module Html
3
3
# === Rails::Html::PermitScrubber
4
4
#
5
- # Rails::Html::PermitScrubber allows you to permit only your own tags and/or attributes.
5
+ # + Rails::Html::PermitScrubber+ allows you to permit only your own tags and/or attributes.
6
6
#
7
- # Rails::Html::PermitScrubber can be subclassed to determine:
7
+ # + Rails::Html::PermitScrubber+ can be subclassed to determine:
8
8
# - When a node should be skipped via +skip_node?+.
9
9
# - When a node is allowed via +allowed_node?+.
10
10
# - When an attribute should be scrubbed via +scrub_attribute?+.
@@ -27,22 +27,22 @@ module Html
27
27
# If set, attributes excluded will be removed.
28
28
# If not, attributes are removed based on Loofahs +HTML5::Scrub.scrub_attributes+.
29
29
#
30
- # class CommentScrubber < Html::PermitScrubber
31
- # def initialize
32
- # super
33
- # self.tags = %w(form script comment blockquote)
34
- # end
30
+ # class CommentScrubber < Html::PermitScrubber
31
+ # def initialize
32
+ # super
33
+ # self.tags = %w(form script comment blockquote)
34
+ # end
35
35
#
36
- # def skip_node?(node)
37
- # node.text?
38
- # end
36
+ # def skip_node?(node)
37
+ # node.text?
38
+ # end
39
39
#
40
- # def scrub_attribute?(name)
41
- # name == "style"
42
- # end
43
- # end
40
+ # def scrub_attribute?(name)
41
+ # name == "style"
42
+ # end
43
+ # end
44
44
#
45
- # See the documentation for Nokogiri::XML::Node to understand what's possible
45
+ # See the documentation for + Nokogiri::XML::Node+ to understand what's possible
46
46
# with nodes: https://nokogiri.org/rdoc/Nokogiri/XML/Node.html
47
47
class PermitScrubber < Loofah ::Scrubber
48
48
attr_reader :tags , :attributes
@@ -160,8 +160,8 @@ def scrub_attribute(node, attr_node)
160
160
161
161
# === Rails::Html::TargetScrubber
162
162
#
163
- # Where Rails::Html::PermitScrubber picks out tags and attributes to permit in
164
- # sanitization, Rails::Html::TargetScrubber targets them for removal.
163
+ # Where + Rails::Html::PermitScrubber+ picks out tags and attributes to permit in
164
+ # sanitization, + Rails::Html::TargetScrubber+ targets them for removal.
165
165
#
166
166
# +tags=+
167
167
# If set, elements included will be stripped.
@@ -180,7 +180,7 @@ def scrub_attribute?(name)
180
180
181
181
# === Rails::Html::TextOnlyScrubber
182
182
#
183
- # Rails::Html::TextOnlyScrubber allows you to permit text nodes.
183
+ # + Rails::Html::TextOnlyScrubber+ allows you to permit text nodes.
184
184
#
185
185
# Unallowed elements will be stripped, i.e. element is removed but its subtree kept.
186
186
class TextOnlyScrubber < Loofah ::Scrubber
0 commit comments