WordPress.org

Ready to get started?Download WordPress

Forums

SyntaxHighlighter Evolved
[resolved] Shortcodes being converted to html (7 posts)

  1. PyroCode
    Member
    Posted 3 years ago #

    In reference to this post: http://wordpress.org/support/topic/415959?replies=6

    It took a long time to find this solution and testing it, it seems to work. I've tried wrapping my code in [php], [sourcecode], and [html] (with closing tags too by the way), which I am using the html option right now.

    Very irritating trying to display "shortcode" samples on the front-end of the site because what was happening is that even though you can see the proper shortcode coding in the editor, as soon as I click save on the editor, the front-end displays the code but it converts the shortcode sample to it's html version. No more shortcode square bracket tags, it's html.

    So seeing that other post, I decided to wrap each shortcode in a double square bracket and sure enough now it shows proper in the front-end.

    So my question is, is this just how it works or is this a band-aid fix for a bug with the plugin or WordPress or both?

    http://wordpress.org/extend/plugins/syntaxhighlighter/

  2. Alex Mills (Viper007Bond)
    Moderator
    Plugin Author

    Posted 3 years ago #

    It's not a bug, it's just how WordPress works.

    My plugin takes everything between it's shortcodes and escapes it so that it doesn't render as HTML (i.e. < to & lt; and so forth). [foobar] doesn't need escaping to be displayed like that, so it's left alone.

    WordPress then comes along later and sees the [foobar], so it replaces it not realizing you didn't want it replaced.

    It'd be possible for my plugin to somehow escape all shortcodes within it's shortcodes, but that'd be a huge undertaking. No thanks. :)

  3. PyroCode
    Member
    Posted 3 years ago #

    Thanks for the follow up Alex...I can understand the "huge undertaking" as I've discovered that working with WP for the past year has been quite the learning experience and I can easily say it's a nightmare to develop for compared to working with a cms system like Joomla (which I enjoy working with for the last 4 years). I find it a lot easier.

    Anyway, good to know about the shortcode part and finally after 2 hours of searching I found that solution. I can also say that your version of the syntaxhighlighter is the better one. Now if only the WordPress development team can work with the end-users instead of themselves, WP could have a more flexible and featured product :)

  4. Alex Mills (Viper007Bond)
    Moderator
    Plugin Author

    Posted 3 years ago #

    There's no need to be a dick to me and the other people who contribute to the WordPress core. If you don't like it, then don't use it.

    I've discovered that working with WP for the past year has been quite the learning experience and I can easily say it's a nightmare to develop for compared to working with a cms system like Joomla (which I enjoy working with for the last 4 years). I find it a lot easier.

    I didn't say that and you likely only find it easier because you're used to it. ;)

    BTW, WordPress allows you to escape shortcodes using double brackets:

    [[shortcode]]

  5. PyroCode
    Member
    Posted 3 years ago #

    wow... not sure where that came from. Obviously took it the wrong way and wasn't my intention. I was referring to me developing for WordPRess, not you or others. Ideally, it's a developers environment and not a designers (which I am more of). Still, I stand by the fact it's still a complicated system to develop for "me" and requires more programming and WordPress knowledge and experience coders

    Anyway, and again, not sure where that sudden defensive statement came from, but as I said, I was referring to myself experiencing a nightmare with learning the WP environment. In Design, there's two areas: (1) designers (2) Developers ....and both requires skills that it's generally difficult to find someone who can do both equally well. A person will either be more of a designer or more of a developer (who lives for code).

    Coffee time!

  6. James
    Happiness Engineer
    Posted 3 years ago #

    Hint: Alex is part of the WordPress development team and probably took offense when you said, "Now if only the WordPress development team can work with the end-users instead of themselves, WP could have a more flexible and featured product."

  7. Strategerizer
    Member
    Posted 3 years ago #

    I tried to escape the gallery shortcode by putting it in double brackets and as soon as I view the page in the Visual tab and save it, WP still processes the gallery shortcode inside the outer brackets... any way to prevent it from doing that.

    I assume that all WP devs with blogs would need to be able to escape shortcodes when explaining usage but I've been researching this for some time now and not \finding a reliable workaround.

    Any suggestions?

    gallery

    (See above how it displays, even though I entered double brackets and below if I add backticks...)

    <a href="http://codex.wordpress.org/gallery">gallery</a>

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic