Class: SlackMarkdown::Filters::MultipleCodeFilter
- Inherits:
-
HTML::Pipeline::Filter
- Object
- HTML::Pipeline::Filter
- SlackMarkdown::Filters::MultipleCodeFilter
- Includes:
- IgnorableAncestorTags
- Defined in:
- lib/slack_markdown/filters/multiple_code_filter.rb
Constant Summary
Constants included from IgnorableAncestorTags
IgnorableAncestorTags::DEFAULT_IGNORED_ANCESTOR_TAGS
Instance Method Summary collapse
Methods included from IgnorableAncestorTags
Instance Method Details
#call ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/slack_markdown/filters/multiple_code_filter.rb', line 11 def call doc.search('.//text()').each do |node| content = node.to_html next if has_ancestor?(node, ) next unless content.include?('`') html = multiple_code_filter(content) next if html == content node.replace(html) end doc end |