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

  1. Wykydtron
    Posted 3 years 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.


  2. Alex Mills (Viper007Bond)
    Plugin Author

    Posted 3 years 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
    Posted 3 years 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. Wykydtron
    Posted 3 years ago #

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

  5. Luca
    Posted 3 years 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

  • SyntaxHighlighter Evolved
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic