WordPress.org

Ready to get started?Download WordPress

Forums

WP-Markdown
[resolved] Angle brackets replaced to HTML entities (10 posts)

  1. gauiis
    Member
    Posted 12 months ago #

    I have a huge problem. I write a lot of code in my articles, so everytime I submit an article all angle brackets (< and >) get replaced to HTML entities (& lt; and & gt;)

    Is there some way to fix this?

    http://wordpress.org/extend/plugins/wp-markdown/

  2. Stephen Harris
    Member
    Plugin Author

    Posted 12 months ago #

    Hi Gauiis,

    If you want to the angular brackets rather than HTML entities you need to use them in as 'inline code' or 'block code'. The first means encasing then in backtics:

    ( seems I can't demonstrate that here. Try: http://daringfireball.net/projects/markdown/syntax#code )

    To display block code, ensure there is a blank line between the code and the text and indent the code by at least 5 spaces.

  3. Stephen Harris
    Member
    Plugin Author

    Posted 12 months ago #

    On second thoughts - even typing an angular bracket < without bactiks should display the angular bracket and not the HTML entity.

    If you're seeing the HTML entity code < then output is being is escaped somewhere. But this isn't a bug with the plug-in.

  4. gauiis
    Member
    Posted 12 months ago #

    Hello again. Thanks for your answer. Indenting the code 5 spaces does nothing. When I edit the post again, the code displays in one line all messed up.

    I'm using Crayon Syntax Highlighter to highlight code on my page. It supports "pre tags" to highlight code. When I use
    "pre" around my code, submit and edit again, WP-Markdown displays the HTML entities (& lt; and & gt).

    This is not a normal behavior - so it must be a bug.

  5. Stephen Harris
    Member
    Plugin Author

    Posted 12 months ago #

    In that case it sounds like a plug-in conflict... I've tested it with Crayon and I can replicate this but only when indenting code by 5/more spaces and *not* wrapping it in pre tags. If not indented or wrapped in pre tags the code displays without problem. (I was able to resolve this by checking "Decode HTML entities in code" in the settings).

    But that's not what you're saying you're doing... so in your case I'm not sure. But I didn't build WP-Markdown with compatibility with Crayon in mind, so there could be a conflict due to the way WP-Markdown handles things (other Markdown plug-ins handle it differently so you might have better luck there).

    WP-Markdown functions correctly on its own, so as far as I can tell its a compatibility issue. Understandable as both plug-ins deal with formatting code.

  6. gauiis
    Member
    Posted 12 months ago #

    But this shouldn't be a problem, because Crayon doesn't render the post admin-side, only viewer-side, but the problem is in rendering admin-side.

    So when I submit a post and then edit it again, all the < > are HTML entities. So the problem is not plugin conflict, the problem is in WP-Markdown.

  7. Stephen Harris
    Member
    Plugin Author

    Posted 11 months ago #

    Can't reproduce this. Have you tried deactivating other plug-ins?

  8. gauiis
    Member
    Posted 11 months ago #

    Yep, deactivated all plugins. Still the same.

    I'm not experiencing this if I copy paste my code from Notepad++ with double TAB for indents. Then the code stays the same. Weird.

    Oh well, then I'll use double TAB indents. Although it's too much. 1 TAB (4 spaces) should be the minimum. Maybe you fix that? :)

  9. manuelbernhardt
    Member
    Posted 11 months ago #

    Hi,

    the workaround with the TAB indentation doesn't work for me.

    I think this is something broken with the WP Markdown plugin, as I don't use any other plugin. Trying to display HTML code as blockquote doesn't work, i.e. all the HTML markup is escaped

  10. manuelbernhardt
    Member
    Posted 11 months ago #

    Ok, an update: when typing the HTML code in (i.e. no copy-paste), indenting it all by hand, things work. Could this be some weird kind of line-ending bug? I am using OS X

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.