You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Apply directives only on tags starting with a letter #28
I searched issues and discussions and couldn’t find anything (or linked relevant results below)
Problem
Our users are reporting problems with writing time values. E.g. the value "12:30pm" is transformed to 12<30pm /> after parsing it with this plugin and converting it to HTML. This will result in displaying just "12" when we will pass this through sanitization that discards unknown tags. Without the sanitization it will throw the error Invalid tag: 30pm and fail to render the text.
I know, that the current recommendation to handle this is to add the escape character like this: "12:30pm", but our users will usualy forget about this or they even don't know about it and they are confused by the missing text.
document.createElement('30pm');
VM2075:1 Uncaught InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('30pm') is not a valid name.
Current solutions
To fix this I would have to create a new remark plugin, that would be ran after remark-directive, that would go through all directives, check their tag names and revert those not starting with a letter back to the plain text.
Proposed solutions
Alter the directives parsing algorhitm to only create directives, if the directive name is starting with a letter.
Hi! Thanks for reaching out! Because we treat issues as our backlog, we close issues that are questions since they don’t represent a task to be completed.
See our support docs for how and where to ask questions.
Activity
JounQin commentedon Mar 11, 2026
Duplicate of #19, micromark/micromark-extension-directive#29, micromark/micromark-extension-directive#30, micromark/micromark-extension-directive#33
github-actions commentedon Mar 11, 2026
github-actions commentedon Mar 11, 2026
Hi! Thanks for reaching out! Because we treat issues as our backlog, we close issues that are questions since they don’t represent a task to be completed.
See our support docs for how and where to ask questions.
Thanks,
— bb