Bug in console/shell-session lexer

Issue #1344 new
Anonymous created an issue

With a certain multi-line input, pygments doesn't seem to be able to do the highlighting properly.

Here is the example that I can't seem to understand. First I'm using "echo" to give the text to highlight to pygmentize. The output is as expected.

% echo "shell$ date\nTue Apr  4 14:09:08 PDT 2017\nshell$" | pygmentize -l console -f html
<div class="highlight"><pre><span></span><span class="gp">shell$</span> date
<span class="go">Tue Apr  4 14:09:08 PDT 2017</span>
<span class="gp">shell$</span>
</pre></div>

Now, I'm using a file that I'm cat'ing to pygmentize. The output is wrong. I don't get why...

% cat test
sshell$ date
Tue Apr  4 14:09:08 PDT 2017
sshell$
% cat test | pygmentize -l console -f html
<div class="highlight"><pre><span></span><span class="go">sshell$ date</span>
<span class="go">Tue Apr  4 14:09:08 PDT 2017</span>
<span class="go">sshell$</span>
</pre></div>

Any idea?

Comments (0)

  1. Log in to comment