gettalong / kramdown

kramdown is a fast, pure Ruby Markdown superset converter, using a strict syntax definition and supporting several common extensions.
http://kramdown.gettalong.org
Other
1.72k stars 274 forks source link

Custom Parser Support #786

Closed aahn33 closed 1 year ago

aahn33 commented 1 year ago

Hey looking into customizing the parser that the Kramdown Document class uses to parse markdown to document format. Basically want to add new element types that the parser can parse when constructing the document. I saw that the parser in the document initialization method can be customized via the options, but the possible options are checked via the parser.rb file. Is adding a new parser that extends the kramdown parser a supported feature?

gettalong commented 1 year ago

Yes, you can do that and it is actually the recommended way to add features. See https://github.com/kramdown/parser-gfm/blob/master/lib/kramdown/parser/gfm.rb for an example.