Class: PostsHelper::PostScrubber
- Inherits:
-
Rails::Html::PermitScrubber
- Object
- Rails::Html::PermitScrubber
- PostsHelper::PostScrubber
- Defined in:
- /var/apps/qpixel/app/helpers/posts_helper.rb
Direct Known Subclasses
Constant Summary collapse
- ALLOWED_ATTRS =
%w[id class href title src height width alt rowspan colspan lang start dir].freeze
- ALLOWED_TAGS =
%w[a p span b i em strong hr h1 h2 h3 h4 h5 h6 blockquote img strike del code pre br ul ol li sup sub kbd section details summary ins table thead tbody tr th td s].freeze
Instance Method Summary collapse
-
#initialize ⇒ PostScrubber
constructor
A new instance of PostScrubber.
- #skip_node?(node) ⇒ Boolean
Constructor Details
#initialize ⇒ PostScrubber
Returns a new instance of PostScrubber.
119 120 121 122 123 |
# File '/var/apps/qpixel/app/helpers/posts_helper.rb', line 119 def initialize super self. = ALLOWED_TAGS self.attributes = ALLOWED_ATTRS end |
Instance Method Details
#skip_node?(node) ⇒ Boolean
125 126 127 |
# File '/var/apps/qpixel/app/helpers/posts_helper.rb', line 125 def skip_node?(node) node.text? end |