stephenharris / WP-MarkDown

WP-MarkDown plug-in. Allows Markdown to be enabled in posts, comments and bbPress forums.
http://wordpress.org/extend/plugins/wp-markdown/
112 stars 19 forks source link

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

Open einkoro opened 10 years ago

einkoro commented 10 years ago

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>
stephenharris commented 10 years ago

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?

einkoro commented 10 years ago

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.

stephenharris commented 10 years ago

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.