Class: PostsHelper::PostTitleScrubber
- Inherits:
-
Rails::HTML::PermitScrubber
- Object
- Rails::HTML::PermitScrubber
- PostsHelper::PostTitleScrubber
- Defined in:
- /var/apps/qpixel/app/helpers/posts_helper.rb
Instance Method Summary collapse
-
#initialize ⇒ PostTitleScrubber
constructor
A new instance of PostTitleScrubber.
- #skip_node?(node) ⇒ Boolean
Constructor Details
#initialize ⇒ PostTitleScrubber
Returns a new instance of PostTitleScrubber.
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
# File '/var/apps/qpixel/app/helpers/posts_helper.rb', line 88 def initialize super attrs = [] = [] allowed_types = SiteSetting['AllowedPostTitleFormattingTypes'] || ['code', 'italic', 'keyboard'] .push('del', 'strike') if allowed_types.include?('strikethrough') << 'code' if allowed_types.include?('code') << 'kbd' if allowed_types.include?('keyboard') << 'em' if allowed_types.include?('italic') << 'strong' if allowed_types.include?('bold') << 'sub' if allowed_types.include?('subscript') << 'sup' if allowed_types.include?('superscript') self. = self.attributes = attrs end |
Instance Method Details
#skip_node?(node) ⇒ Boolean
107 108 109 |
# File '/var/apps/qpixel/app/helpers/posts_helper.rb', line 107 def skip_node?(node) node.text? end |