How do I correctly get the 'code' shortcode to display my raw HTML?

  • Unknown's avatar

    Hi there. I’m trying to write a post comparing WordPress shortcodes to HTML & am getting some odd behaviour when using the [code] shortcode.

    I've documented the issue on this post http://kangarara.wordpress.com/2014/09/07/trouble-with-shortcodes/ (including screenshots) and am baffled. Basically, raw HTML within [code] is being stripped upon save, and shortcode code within [code] is being reversed back into HTML upon rendering.

    What am I doing wrong? Thanks!

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    I’ll tag this thread for Staff assistance because I do not know how to help you. Another Volunteer may answer prior to Staff but I tagged the thread so it will not fall through the cracks and escape attention. Please subscribe to the thread so you are notified when they respond and please be patient while waiting.

    reference link http://en.support.wordpress.com/shortcodes/

  • Unknown's avatar

    Hi there!

    Thanks so much for that write up. That made it super easy to see what you were doing and what was getting stripped.

    Your first code snippet is being stripped because of our security stripping scripts. We don’t allow iframes to be directly embedded. The second one is being converted by our system from the shortcode into what your browser would actually display if you were embedding that map in your site.

    Currently, the best way for you to do this is going to be using Gist. We have both oEmbed and shortcodes for Gist:

    http://en.support.wordpress.com/gist/

    I’ll also post a request for our developers to take a look, but they’re pretty busy with projects right now.

  • Unknown's avatar

    Cool, thanks very much. I’ll give that a try. Since you’ve answered, I’ll mark this as resolved (if Gist doesn’t work, that means I have a different problem ;)

  • Unknown's avatar

    Let me know if I can help with anything else! :)

  • Unknown's avatar

    Hi there! I just wanted to let you know that our developers have got a fix for this issue deployed. You can now post shortcode-related code in the source code tags and we won’t strip it.

    Let me know if you have any trouble doing that! :)

  • The topic ‘How do I correctly get the 'code' shortcode to display my raw HTML?’ is closed to new replies.