new editor has trouble handling HTML code listings

  • Author
    Posts
  • #2367878

    Hello, I was recently editing an existing post at my blog, thiscouldbebetter.wordpress.com, which consists mostly of code listings of JavaScript programs contained within a bare-bones HTML page. These are just code listings, not runnable programs, since of course by design WordPress.com doesn’t support runnable programs for (I assume) security reasons. Each of my code listings is structured as a
    <pre> element whose contents are escaped to render correctly as text. For example, each instance of “<” is replaced with “<“, and so forth.

    I made a simple change to the code in one of my listings (specifically, adding a missing “var” keyword) and re-saved using the “new” editor (the one that goes “Beep Beep Boop”). After that, the post no longer rendered correctly. I re-edited the post and saw that it had been significantly altered via some automagical process. To restore my post to readability, I had to revert to a previous revision and make updates via the “Classic” editor on the WP Admin page (though not before looking long and hard for the revision history option on the “New” editor, which I was shocked to learn has been intentionally descoped (Editorial: WHAAAAAA….?)).

    Upon opening other posts in the “New” editor, I found a whole host of rendering problems, with many instances of the escaped HTML tags in my code listings being interpreted as real, unescaped tags. Like, the <button> elements in my listing were rendered as real-life buttons. In many cases, the text of my code listing did not appear at all, being replaced by a small empty gray rectangle.

    Anyway, I thought I should probably report this bug, but I wasn’t able to find any obvious “report a bug” option in the Support pages, so I’m posting it here in the forums. If this problem has not already been reported, and if further tasks are required to bring this to the attention of WordPress.com staff, could someone more knowledgable please let me know?

    And to the staff, thank you for providing this service, and keep up the good work.

    The blog I need help with is thiscouldbebetter.wordpress.com.

    #2367978

    Ah, apparently I need to escape my HTML symbols here as well. Good to know. Editing and re-submitting…
    =========

    Hello, I was recently editing an existing post at my blog, thiscouldbebetter.wordpress.com, which consists mostly of code listings of JavaScript programs contained within a bare-bones HTML page. These are just code listings, not runnable programs, since of course by design WordPress.com doesn’t support runnable programs for (I assume) security reasons.

    Each of my code listings is structured as a
    <pre>
    element whose contents are escaped to render correctly as text. For example, each instance of a less-than sign is replaced with “<“, and so forth.

    I made a simple change to the code in one of my listings (specifically, adding a missing “var” keyword) and re-saved using the “new” editor (the one that goes “Beep Beep Boop”). After that, the post no longer rendered correctly. I re-edited the post and saw that it had been significantly altered via some automagical process. To restore my post to readability, I had to revert to a previous revision and make updates via the “Classic” editor on the WP Admin page (though not before looking long and hard for the revision history option on the “New” editor, which I was shocked to learn has been intentionally descoped (Editorial: WHAAAAAA….?)).

    Upon opening other posts in the “New” editor, I found a whole host of rendering problems, with many instances of the escaped HTML tags in my code listings being interpreted as real, unescaped tags. Like, the <button> elements in my listing were rendered as real-life buttons. In many cases, the text of my code listing did not appear at all, being replaced by a small empty gray rectangle.

    Anyway, I thought I should probably report this bug, but I wasn’t able to find any obvious “report a bug” option in the Support pages, so I’m posting it here in the forums. If this problem has not already been reported, and if further tasks are required to bring this to the attention of WordPress.com staff, could someone more knowledgable please let me know?

    And to the staff, thank you for providing this service, and keep up the good work.

    #2367980

    Okay, system, you win, I give up. I have no idea how to talk about HTML without it being interpreted as HTML. : )

    #2367984

    timethief
    Member

    thiscouldbebetter.wordpress.com, which consists mostly of code listings of JavaScript programs contained within a bare-bones HTML page.

    I tagged this thread for Staff assistance. Please subscribe to it so you are notified when they respond. To subscribe look in the sidebar of this thread, find the subscribe to topics link and click it.

    #2368121

    rachelmcr
    Staff

    Thanks for reporting this, and my apologies for the trouble! This seems to be a bug that just won’t die. I let our team know that this is still causing trouble in the new editor so they can look into that. (We ironed out these issues if you use the Source Code Shortcode, but it looks like the same issues are affecting the preformatted tag — I’ll see if we can apply a similar fix for that.)

    Okay, system, you win, I give up. I have no idea how to talk about HTML without it being interpreted as HTML. : )

    You can use backticks around HTML code (or highlight your code and hit the “code” button above the form) to post HTML in the forums here. Some things like HTML entities will still be interpreted, due to some aggressive encoding that our forums do, but those backticks will help with sharing most HTML here.

    Please let me know if I can do anything more to help. :)

The topic ‘new editor has trouble handling HTML code listings’ is closed to new replies.