-
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
pre's inside html #378
Comments
Just ran into this one too. @ianstormtaylor have you found a workaround yet? Doesn't seem like this one's being actively maintained anymore. |
I run into this even with something as simple as <pre>![image](http://example.com/image.jpg)</pre>
More markdown. The image gets processed into an |
If you can run javascript, you can set "marked.setOptions({pedantic: false});" to avoid marked breaking from the markdown spec and interpreting inside html blocks altogether. Otherwise quick fix is to just use markdown (triple backticks, etc) inside the html blocks to set preformatted text or include *, etc. @rymohr I think the html blocks need to be surrounded by blank lines. |
Marked does an awesome thing where it lets you write markdown formatted strings inside HTML inside your markdown, so that you can for example make a
<table>
or<figure>
and not have to resort to using<strong>
or<em>
. That is sweet.Just ran into an issue though where
<pre>
tags aren't getting properly skipped for that inline formatting. Basically the check for whether to skip a block of HTML only checks the parent element, instead of nested<pre>
tags, so an example like this will still have inline formatting applied:In this case, since the top-level tag is
<figure>
Marked is still applying the inline formatters to the entire block, even though all of the<pre>
children shouldn't have them applied.The text was updated successfully, but these errors were encountered: