Class: Kramdown::Parser::Kramdown
- Inherits:
-
Object
- Object
- Kramdown::Parser::Kramdown
- Defined in:
- lib/rabbit/parser/markdown.rb
Instance Method Summary collapse
- #configure_parser ⇒ Object
- #configure_parser_raw ⇒ Object
- #handle_extension(name, opts, body, type, line_no = nil) ⇒ Object
- #handle_extension_raw ⇒ Object
- #parse_codeblock_fenced_gfm ⇒ Object
Instance Method Details
#configure_parser ⇒ Object
22 23 24 25 26 27 |
# File 'lib/rabbit/parser/markdown.rb', line 22 def configure_parser position = @block_parsers.index(:codeblock_fenced) @block_parsers.insert(position, :codeblock_fenced_gfm) configure_parser_raw end |
#configure_parser_raw ⇒ Object
21 |
# File 'lib/rabbit/parser/markdown.rb', line 21 alias_method :configure_parser_raw, :configure_parser |
#handle_extension(name, opts, body, type, line_no = nil) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/rabbit/parser/markdown.rb', line 11 def handle_extension(name, opts, body, type, line_no=nil) case name when "wait" @tree.children << Element.new(:wait, body, nil, :category => type, :location => line_no) true else handle_extension_raw(name, opts, body, type, line_no) end end |
#handle_extension_raw ⇒ Object
10 |
# File 'lib/rabbit/parser/markdown.rb', line 10 alias_method :handle_extension_raw, :handle_extension |
#parse_codeblock_fenced_gfm ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/rabbit/parser/markdown.rb', line 31 def parse_codeblock_fenced_gfm original_match = self.class::FENCED_CODEBLOCK_MATCH begin self.class.send(:remove_const, :FENCED_CODEBLOCK_MATCH) self.class.const_set(:FENCED_CODEBLOCK_MATCH, GFM::FENCED_CODEBLOCK_MATCH) parse_codeblock_fenced ensure self.class.send(:remove_const, :FENCED_CODEBLOCK_MATCH) self.class.const_set(:FENCED_CODEBLOCK_MATCH, original_match) end end |