Module: MCMarkdown::Formatter::Blocks
- Included in:
- Base
- Defined in:
- lib/mc_markdown/formatters/blocks.rb
Defined Under Namespace
Classes: BlockFormatter
Instance Method Summary collapse
Instance Method Details
#postprocess(doc) ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/mc_markdown/formatters/blocks.rb', line 21 def postprocess doc doc = Parser::BlockTag.new(doc, BlockFormatter).parsed if defined?(super) return super(doc) else return doc end end |
#preprocess(doc) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/mc_markdown/formatters/blocks.rb', line 5 def preprocess doc doc.gsub!( Parser::BlockTag::Block.open_block ) do |match| "\n\n#{match}\n\n" end doc.gsub!( Parser::BlockTag::Block.close_block ) do |match| "\n\n#{match}\n\n" end if defined?(super) return super(doc) else return doc end end |