require 'html/pipeline' class HelpMarkdownFilter < HTML::Pipeline::MarkdownFilter def call html = super format_callout!(html) end def format_callout!(html) html.gsub!(/(?:

)?{{#(tip|warning|error)}}(?:<\/p>)?/, '

') html.gsub!(/(?:

)?{{\/(tip|warning|error)}}(?:<\/p>)?/, '

') end end