Class: Kramdown::Parser::Mygfm

Inherits:
GFM
  • Object
show all
Defined in:
lib/kramdown/ansi.rb

Overview

A custom Markdown parser that extends GFM to provide enhanced parsing capabilities for Kramdown::ANSI.

This class modifies the standard GFM parser by disabling certain quirks and removing specific block and span parsers to tailor the Markdown processing for ANSI terminal output.

Examples:

Using the Mygfm parser with Kramdown::ANSI

parser = Kramdown::Parser::Mygfm.new(markdown_content, {})
document = Kramdown::Document.new(markdown_content, input: :mygfm)

Instance Method Summary collapse

Constructor Details

#initialize(source, options) ⇒ Mygfm

Returns a new instance of Mygfm.



74
75
76
77
78
79
80
81
82
# File 'lib/kramdown/ansi.rb', line 74

def initialize(source, options)
  options[:gfm_quirks] << :no_auto_typographic
  super
  @block_parsers -= %i[
    definition_list block_html block_math
    footnote_definition abbrev_definition
  ]
  @span_parsers -= %i[ footnote_marker inline_math ]
end