Class: Perron::HtmlProcessor::TargetBlank
- Defined in:
- lib/perron/html_processor/target_blank.rb
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Perron::HtmlProcessor::Base
Instance Method Details
#process ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/perron/html_processor/target_blank.rb', line 8 def process @html.css("a").each do |link| href = link["href"] next if href.blank? || href.start_with?("/", "#", "mailto:") link["target"] = "_blank" end end |