-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
[Suggestion] Provide Escaping Options in Lexer #3491
Comments
I noticed this a little bit ago. I am working on moving the escaping to the renderers instead of the tokenizers. The Tokenizers should just pull the information out of the markdown and create tokens without changing it, then the renderers should handle any changes like HTML escaping. |
Your proposal seems better and more logical. Even though I’m only using the tokenizer and not the renderer in my case, do you still plan to make HTML escaping optional inside the renderer? |
No. The default renderers will always escape since that follows the CommonMark spec but they can be overridden |
Got it. |
Describe the feature
Is it possible to provide an option in the lexer, like
enableEscaping: boolean;
that controls the lexer should turn any characters (e.g.&
,<
,>
etc) into escaping characters (e.g.&
,<
,>
etc).Why is this feature necessary?
{type: 'codespan', raw: '<h1>', text: '<h1>'}
. I wish to display the text normally. I have to use extra calculations like regular expressions to turn<h1>
back to<h1>
.marked
) which caused meaningless extra calculations.Describe alternatives you've considered
I saw the issue answered in 2022 said I have to override the tokenizer to achieve this.
The text was updated successfully, but these errors were encountered: