Support » Plugin: WP-Markdown » [Plugin: WP-Markdown] Greater than (>) is incorrectly encoded

  • Hi, WP Markdown is a great and useful plugin, I’ve just encountered one minor issue with it. When visitor writes this into their comment:

    (backticks)dibi::update('users', $_POST)->where(...)->execute();(backtics)

    It will be displayed as

    dibi::update('users', $_POST)->where(...)->execute();

    Instead of greater than sign (>), WP Markdown outputs “&gt” which is displayed as “&gt” in the browser. Any hint on how to fix this?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Sorry the last sentence should read:

    Instead of greater than sign (>), WP Markdown outputs &gt (in case eats this, there is an “amp” HTML entity) which is displayed as &gt in the browser. Any hint on how to fix this?

    Sorry I’ve noticed that this forum screwed my original post in one more way, there should be “gt” entities in the output example, not PHP arrows.

    Plugin Author Stephen Harris


    Again – I’ve tested this and it works fine form. Chances are that the root cause is also the cause of your other bug report.

    Same advice as before I’m afraid. On a fresh install of WordPress with TwentyEleven theme there is no issue. It’s a pain but if you deactivate your theme and plug-ins and re-activate theme one by one until the problem reoccurs that will identify the culprit.

    Maybe could you suggest a hook / action I should look for in other plugins to see if something interferes with WP-Markdown?

    Plugin Author Stephen Harris


    Apologies. I did a few more tests – the problem is because logged out users cannot post html, and this is usually stripped out with wp_kses, which, in this instance, runs when a comment is saved. The Markdown parser is hooked onto the same filter, but is running after wp_kses as stripped out any html (like the >). Changing the priority so that the Markdown is parsed first solves the problem, and the other related bug report.

    I shall update plug-in at some point, but if you wish to fix it yourself in the meantime, line 67 of the wp-markdown.php should read:
    (note the 5)

    Hi. I don’t know if this is a related issue or not, but I’m also having trouble with the greater and less than characters in posts.

    I tend to write my posts in a markdown text editor, then paste into WordPress when I’m done.

    Here are steps to reproduce my issue:

    1. Paste markdown into the WordPress post editor (where Markdown contains greater-than and less-than characters written in HTML entity form).

    2. Click on ‘Save draft’. Notice that all my greater-than and less-than HTML entities have been replaced with a real greater-than or less-than symbol, which then stops them from rendering when I do a preview.

    Other than this issue – well done on an awesome plugin though! Very very useful! 🙂

    Plugin Author Stephen Harris


    The > and < symbols display correctly for me. If you want to display, and not render HTML, then you can enclose it in backtics, or put it on a separate line and indent by 4 or more spaces.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: WP-Markdown] Greater than (>) is incorrectly encoded’ is closed to new replies.