WP-MarkDown icon indicating copy to clipboard operation
WP-MarkDown copied to clipboard

image html elements in code blocks or inline code are not turned into entities

Open einkoro opened this issue 11 years ago • 3 comments

Input

    <img src="http://images.gameskinny.com/gameskinny/fc8689799b33e2d4c73b816f7b2c26a3.jpg">

asdf `<img src="http://images.gameskinny.com/gameskinny/fc8689799b33e2d4c73b816f7b2c26a3.jpg">` asdf

Output:

<pre class="prettyprint prettyprinted"><code><img src="http://images.gameskinny.com/gameskinny/fc8689799b33e2d4c73b816f7b2c26a3.jpg">
</code></pre>
<p>asdf <code><img src="http://images.gameskinny.com/gameskinny/fc8689799b33e2d4c73b816f7b2c26a3.jpg"></code> asdf</p>

einkoro avatar May 31 '14 21:05 einkoro

Mmm... I can't replicate this (and have added a unit test to check it). Perhaps another plug-in is upsetting things? Could you try with everything else disabled?

stephenharris avatar May 31 '14 22:05 stephenharris

Did you test this as a regular user or moderator/admin? It only seems to be occuring on regular user accounts – admin and moderators end up with the correct output.

einkoro avatar May 31 '14 23:05 einkoro

Ah yes, you're right.

Something must be happening to it before it reaches wpmarkdown_markdown_to_html() as that function runs independently of the user (and has been verified by a unit test).

My guess at this point that this is related to bbpress strict whitelisting of allowed tags (https://gist.github.com/stephenharris/6078242). Though I could be wrong.

stephenharris avatar May 31 '14 23:05 stephenharris