feat: export mkLang to help extend the parser #5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/export-mklang"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I am trying to extend the GFM markdown parser.
However, the package only exports commonmark and GFM Langauges.
I know I can retrieve
MarkdownParserby those waysHowever, I cannot recreate
LanguagefromMarkdownParsersincemkLangis not exported by the package.This PR exports
mkLangfrom the package.Examples
In order to extend the GFM Parser currently, the bolierplate code should be copied.
If the
mkLangis exported, we can remove this boilerplate code.That is intentionally not public. Use
markdown({...}).language.parser. Also, if you create a PR, don't include a bunch of changes your IDE automatically reformatted.Please recheck the issue. I know I can access the parser from
Languageinstance.However, the
markdown()function acceptsLanguageas abase, notMarkdownParser, so we need a method that re-converts modifiedMarkdownParsertoLangaugePass your extensions in the
extensionsfield tomarkdown(), and it will modify the base language for you.Ohhh... Thanks
Pull request closed