Class: HTML::Pipeline::AutoCorrectFilter
- Inherits:
-
Filter
- Object
- Filter
- HTML::Pipeline::AutoCorrectFilter
- Defined in:
- lib/html/pipeline/auto_correct_filter.rb
Instance Method Summary collapse
Instance Method Details
#call ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/html/pipeline/auto_correct_filter.rb', line 8 def call doc.xpath(".//text()").each do |node| content = node.to_html next if has_ancestor?(node, %w[pre code]) html = ::AutoCorrect.format(content) next if html == content node.replace(html) end doc end |