Skip to content
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

HTML code blocks are not escaped #5

Open
emmasax opened this issue Dec 5, 2017 · 4 comments
Open

HTML code blocks are not escaped #5

emmasax opened this issue Dec 5, 2017 · 4 comments

Comments

@emmasax
Copy link

emmasax commented Dec 5, 2017

If I have a markdown file containing:

```html
<div>Hello world</div>
```

The output of the pre/code blocks is not escaped, so the HTML renders on the page instead of being readable code.

I found this which explains it exactly: https://stackoverflow.com/questions/47279702/markdown-imported-file-not-writing-escaped-characters-in-fences

@emmasax emmasax changed the title HTML code blocks are stripped out HTML code blocks are not escaped Dec 5, 2017
@doowb
Copy link
Member

doowb commented Dec 5, 2017

@emmasax thanks for the issue and linking back to the SO question. I'll take a look at this and see if we can remove the unescaping. There is another markdown helper that doesn't unescape and I think this one should follow that same pattern.

@emmasax
Copy link
Author

emmasax commented Dec 6, 2017

@doowb What is the other markdown helper, out of interest?

@doowb
Copy link
Member

doowb commented Dec 6, 2017

The other helper is helper-markdown. It works as a block helper that renders the markdown from inside the block.

@pfzetto
Copy link

pfzetto commented Oct 23, 2020

Handlebars escapes the html automatically if you use {{md "path/to/file.md"}}. To get the raw html use {{{md "path/to/file.md"}}}

For more info look here: https://handlebarsjs.com/guide/expressions.html#html-escaping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants