Code block highlight becomes broken if code block contains ${variable} and symbol '<'
slavniyteo opened this issue · 3 comments
Hello. I printscrined the problem:
I used next markdown sources (you may use it for test, for example):
# Hello
Look at next code block.
command -stdin <<EOP
first line in stdin
second line in stdin
EOP
This is similar code block with ${variable} highlighted. But it looks broken.
command -stdin ${variable} <<EOP
first line in stdin
second line in stdin
EOP
It looks broken even if ${variable} present anywhere in code block.
command -stdin <<EOP
first line in stdin
second line in stdin
EOP
${variable}
Actually it works if code block contains ${variable} and <:
First string <
Second string with ${var}.
Third string.
# The end.
hey, verified, not exactly pretty...
The problem is the which lexer pygments chooses to take. With your file it seems to choose "TextLexer".
You can influence that decision.
1.
Via the markdown source, e.g.:
2.
Via the cli:
( -x
switches off the guessing and -X bash
says default to take is the bash lexer)
hope one of those options is feasible for you - or should I introduce a mode where all code is gray always if not explicitly given... Hmmm...
re-open if not happy.
Thank you for detailed answer.
I like ```bash-like style (I have not a lot of experience with Markdown), it provides explicit language declaration. It is good, I think.
But may markdown viewer highlight all lines in block <<EOF ... EOF
instead only first <<EOF
?
I have not permissions to reopen the issue.