Description
This markdown package currently supports one non-standard syntax (the code fence), and there are open issues requesting support for more (see #1466, dart-lang/markdown#38, dart-lang/markdown#41, and dart-archive/markdown#31). It's of course up to the maintainers whether to include any more non-standard syntaxes beyond code fences, but the none of these issues has been outright rejected.
When syntax extensions are supported in a Markdown parser, they should be able to be toggled, to reduce surprises (see Pandoc, Redcarpet, and others). This is the primary reason for having a formal specification: this package shouldn't format a user's Markdown strangely because it chose to include one certain non-standard syntax, and to always include it.
I propose a new argument to markdownToHtml()
and new Document()
, perhaps List<String> extensions
. This argument defaults to []
. The different values might include:
"code_fences"
(already implemented)"inline_html"
(Minor change to kick off mirroring #18)"tables"
(Error handling for malformed session file #38)"no_intra_word_emphasis"
(Update README.md #41)"header_ids"
(Adding more information toLogFileStats
+ minor updates to tests #31)
I realize that this package already supports user-written, inline syntax extensions per-document, but supporting user-written block syntaxes would be very hard, as they would want access to the different private patterns, etc (for example how ListSyntax uses all the other block syntax patterns to see whats up). So if this opens the door to non-standard block syntaxes like tables, and definition lists, then its a super win.
This new argument also eases some anxiety of adding a new syntax extension: it will always be safely disabled by default, and only enabled when the user chooses to use it.
If y'all like the idea, I'm happy to send a PR adding the argument, and disabling the FencedCodeBlockSyntax by default.