WordPress.org

Ready to get started?Download WordPress

Forums

SyntaxHighlighter Evolved
[resolved] backslash stripped from [bash] regex? :( (5 posts)

  1. chaos1
    Member
    Posted 1 year ago #

    Hello, I can't seem to find help with this.

    I am trying to write a regex and display it on my blog but i noticed backslashes being stripped from my regex using [bash] or [shell]

    Example would be "\.\.|\.exe" - strips all backslashes

    When I attempt to use the HTML entity, it obviously doesn't translate.

    \.\.|\.exe edit: oh wow & # 9 2 ; translates to a backslash even if i use code, lol. -_-

    Is there shortcode i can use to insert the backslash entity and have it display?

    :) Thank you.

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

  2. Alex Mills (Viper007Bond)
    Moderator
    Plugin Author

    Posted 1 year ago #

    The problem is WordPress passes slashed POST data through the filters I use. I have to strip the slashes, do the content modification, and then add the slashes back.

    Your slashes are being caught in the crossfire and being removed. :(

    I can't think of a good solution, other than perhaps double-backslashes.

    You can read more on the insanity here: http://core.trac.wordpress.org/ticket/21767

  3. Luca
    Member
    Posted 1 year ago #

    I have the same problem with backslashes and square bracket when trying to color some bash command.

    For example [bash]PS1="\[\e[1;31m\]cnodev\[\e[0m\]@\h:\w\$ "[/bash]
    is not displayed properly...

    In my case even using the html code for the square bracket doesn't help.
    How can I type such code in my blog?

    Thanks for the help, and thanks Alex for this nice plugin!

  4. chaos1
    Member
    Posted 1 year ago #

    Until they fix core and how they handle slashes I am just using pastebin Embed. :/

  5. Luca
    Member
    Posted 1 year ago #

    Hi chaos can you be a bit more precise?
    What is pastebin embed? I really would like to
    post some bash commanda and I am stuck!

    Thanks for the help!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic