-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Escaping characters (angle brackets, etc.) in code blocks/snippets #400
Comments
Hi @devEngine It's like this by design and required by markdown spec, or else code snippets could end up messing the generated html. All markdown implementations do this (check babelmark2 For instance:
This would generate:
In fact, it is required by HTML spec that, at least, < symbols should be escaped, even inside code blocks. |
Thanks very much for your response - and I'm sure it's me missing something so apologies once again. I have this in my original markdown content (between the 3 backticks):
and no matter how I escape the brackets, I always end up getting from the converter:
Any ideas how I should escape these to display the actual brackets? |
Sorry, got it with reference to your helpful link. Thanks for your assistance! |
I'm certain this has been asked elsewhere and/or described in some bit of documentation but I'm missing the solution and can't find it (I plead forgiveness in advance).
I've got template content which I load into a div as follows for which I use showdownjs to convert to html as follows:
This works pretty well except that any/all code snippets containing angle brackets for greater-than or less-than signs get HTML-escaped, thus:
< becomes <
> becomes >
and so on. Just for the record, such sections appear in markdown-compliant code outtakes (between the '```' markers) but these get escaped anyway. Would some kind soul please point me in the right direction as to how to workaround this?
Apologies as I don't want to create an issue where it's not warranted, but I can't seem to find the answer anywhere (don't think it's related to the HTML tag escaping issue: #374) but not sure.
Thanks in advance for any help.
The text was updated successfully, but these errors were encountered: