Visual Editor removes the escaped attribute (3 posts)

  1. randyhoyt
    Posted 3 years ago #

    If my code has HTML entities already encoded, I need to add escaped="true" to the pre element. However, when I click back to the visual editor and save the page, the escaped attribute gets removed.


  2. randyhoyt
    Posted 3 years ago #

    I found a workaround for this. If you are switching back to the visual editor after editing the code, then instead of this ...


    ... you can use this ...


    The WordPress visual editor won't remove that because it is a valid attribute in HTML5. (You can create your own attributes that begin with data-. WP Syntax finds the escaped="true" part in there and treats it as escaped code.

  3. randyhoyt
    Posted 3 years ago #

    Actually, on closer inspection, this does not exactly work. This makes WP Syntax ignore the code block altogether. The HTML displays correctly (the code is not longer double escaped), but it does not have any of the syntax highlighting.

    I'll try to work on a patch to the plugin that will make it honor the data-escaped="true" attribute and post it here.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP-Syntax
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.