WordPress.org

Ready to get started?Download WordPress

Forums

WP-Syntax
Visual Editor removes the escaped attribute (3 posts)

  1. randyhoyt
    Member
    Posted 1 year 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.

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

  2. randyhoyt
    Member
    Posted 1 year ago #

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

    escaped="true"

    ... you can use this ...

    data-escaped="true"

    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
    Member
    Posted 1 year 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

About this Topic

Tags

No tags yet.