mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-04 05:44:50 +00:00
Reasonable OpeningCharacters for Extensions #720
Reference in New Issue
Block a user
Delete Branch "%!s()"
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?
Originally created by @rhjoerg on GitHub (Feb 2, 2025).
Introduction
I am currently working on some MarkDig extensions. Something like:
where
!frontmatter{Author, Published}will insert a table showing the requested values. Still a long way to go.The Question
What would be a reasonable OpeningCharacters for such extensions to not clash with other/existing extensions?.
@xoofx commented on GitHub (Feb 2, 2025):
The OpeningCharacters can clash with other existing extensions, as long as you match the following (e.g.
frontmatter{in your parser and discard if it is not matched.OpeningCharactersis an optimization for the parser to quickly select which parser it might try instead of trying all of them.See for example AlertInlineParser that is matching
[but then validating that it is e.g.[!NOTE]and discarding if not.@rhjoerg commented on GitHub (Feb 3, 2025):
Thanks for your fast response.