Class: Html2rss::AttributePostProcessors::SanitizeHtml
- Inherits:
-
Object
- Object
- Html2rss::AttributePostProcessors::SanitizeHtml
- Defined in:
- lib/html2rss/attribute_post_processors/sanitize_html.rb
Instance Method Summary collapse
- #get ⇒ Object
-
#initialize(value, _options, _item) ⇒ SanitizeHtml
constructor
A new instance of SanitizeHtml.
Constructor Details
#initialize(value, _options, _item) ⇒ SanitizeHtml
Returns a new instance of SanitizeHtml.
6 7 8 |
# File 'lib/html2rss/attribute_post_processors/sanitize_html.rb', line 6 def initialize(value, , _item) @value = value end |
Instance Method Details
#get ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/html2rss/attribute_post_processors/sanitize_html.rb', line 10 def get Sanitize.fragment(@value, Sanitize::Config.merge( Sanitize::Config::RELAXED, add_attributes: { 'a' => { 'rel' => 'nofollow noopener noreferrer', 'target' => '_blank' } } )) end |