Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined control sequence \e #135

Closed
petros opened this issue Apr 11, 2011 · 5 comments
Closed

Undefined control sequence \e #135

petros opened this issue Apr 11, 2011 · 5 comments
Labels

Comments

@petros
Copy link

petros commented Apr 11, 2011

Add the following in a wiki page

GIT_PS1_SHOWDIRTYSTATE=true
export PS1='\[\e[1;33m\]$(__git_ps1)'$PS1

when the page is rendered you get "Undefined control sequence \e"

Maybe this is caused by MathJax

@mbaltaks
Copy link

I'm seeing the same thing.

The following just won't render correctly in a github wiki page, with either code block syntax.

function parse_git_dirty
{
  [[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}

export PS1='\u@\h:\w$(__git_ps1 "[\[\e[0;32m\]%s\[\e[0m\]\[\e[0;31m\]$(parse_git_dirty)\[\e[0m\]]")$ '

@awbush
Copy link

awbush commented Sep 25, 2011

I'm having this issue too. Would have thought that the point of code blocks is to disable any parsing, as is done in other markdown parsers.

@yangchenyun
Copy link

Me, too. It seems escaped character will have this issue.

var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,

Will alert
Undefined control sequence \( and Undefined control sequence \[

@wch
Copy link

wch commented Dec 23, 2011

I get weird math formulas when I do this, but if I put a space between the first backslash and opening square bracket, it displays properly (except for the extra space). Is there a way to work around this? I'm trying to put a bash prompt command on a github wiki page.

Bad:

export PS1='\[\e[1;33m\]$(__git_ps1)'$PS1

OK:

export PS1='\ [\e[1;33m\]$(__git_ps1)'$PS1

@atmos
Copy link
Contributor

atmos commented May 2, 2012

@tanoku is there a way to handle this without the space? It still inserts mathematical formulas.

@vmg vmg closed this as completed in 2bea800 May 3, 2012
existme pushed a commit to existme/gollum that referenced this issue Aug 9, 2018
Code blocks get extracted first.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants