Class: PostsHelper::PostScrubber

Inherits:
Rails::Html::PermitScrubber
  • Object
show all
Defined in:
/var/apps/qpixel/app/helpers/posts_helper.rb

Direct Known Subclasses

TagsHelper::TagWikiScrubber

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

Constructor Details

#initializePostScrubber

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.tags = ALLOWED_TAGS
  self.attributes = ALLOWED_ATTRS
end

Instance Method Details

#skip_node?(node) ⇒ Boolean

Returns:

  • (Boolean)


125
126
127
# File '/var/apps/qpixel/app/helpers/posts_helper.rb', line 125

def skip_node?(node)
  node.text?
end