WordPress.org

Support

Support » Plugins and Hacks » Need to escape html inside <code> tags

Need to escape html inside <code> tags

  • dougrdotnet
    Member

    @dougrdotnet

    Hi, I’ve been having issues with rendering of HTML in posts which contain code within <code> tags. I migrated from another platform which did not need for me to also use a <pre> tag. I wrote a sql script to find and replace with <pre><code> (and the ending tags too) but now I need to escape all < & > with < and > respectively.
    Does anyone have a sql string script which will replace < & > in between designated strings?
    Option 2, Server.HTMLEncode(): does WP use this to html encode chars when using <code>. It looks like it only escapes upon insert but not on select. How/Where does WP process html strings?
    Thanks

  • The topic ‘Need to escape html inside <code> tags’ is closed to new replies.