-
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow the library user to specify a list of directive names, that they indend to parse #10
Comments
Hey hey! The whole point of directives is that they are all supported even when unknown. As an author, you can choose to turn this character into a plain colon: I do think the 1st alternative you mention is quite viable for several systems. Such as if you’d make GH comments, where authors are only expected to write known directives, and not expected to write unknown directives. |
Thank you for the quick response!
I agree, especially for the formatting use case. For other use-cases on the other hand, like rendering markdown, I'd want the parser to behave differently, which could be done by adding an option like |
If a tool supports unknown directives when rendering, like GH in this example, it would display the component. Just like how GH shows frontmatter data as a table. It doesn't understand what the keys and values mean but it can still display it. |
Closing. I don’t think this should be done. I think the point is to have an unambiguous syntax for components. Whether they are known or not. |
This comment has been minimized.
This comment has been minimized.
@csicar I'm running into this as well in an environment where colons are used as text commonly in the markdown. Did you ever find a solution to avoid parsing (or at least rendering( unknown directives? |
Yeah.. I know. I ended up just not using this plugin and implementing the parsing on my own. |
Ah ok. Maybe I'l l look into that as well :/ (Care to open source yours?? 😂 ) |
Initial checklist
Problem
When the markdown contains a
:
, but that is not part of a directive, it is still parsed as one. E.g. in german, there is a style of gendering that uses:
as part of a wordThis gets parsed as a directive
:innen[]
Solution
Allow the library user to specify what directive names should be accepted as part of the parsing and which should be skipped.
Alternatives
I see two alternatives:
:innen
or:innen[]
just from the AST\w:\w
as a directive. I think this is undesirable because it changes the parsing in a non-backward-compatible way and only fixes this specific problemThe text was updated successfully, but these errors were encountered: