151: Using Pygments removes initial blank lines

cuv****@gmai***** (Google Code) (Is this you? Claim this profile.)
July 9, 2007
What's the URL of the page containing the problem?
/r/##/diff/

What steps will reproduce the problem?
1. Enable diff syntax highlighting in RB.
2. Create a file in your repo with the first line blank.
3. Make changes to that file (other than the first line) and submit a patch
to RB.
4. View the resulting side-by-side diff.

What is the expected output? What do you see instead?
The change highlighting will be on incorrect lines, with the real change
being N lines above (where N is the number of initial blank lines).

There's also a nasty case where you end up trying to highlightregion on a
blank line, which leads to an exception.

What operating system are you using? What browser?
RHEL5
Python 2.4.3
Pygments 0.8.1

Please provide any additional information below.
This line-stripping behavior of Pygments may well be intentional, since
most users probably don't want blank lines.  But for RB's diff viewer,
those blank lines are necessary to line up changes with the code.

Pygments also seems to remove trailing blank lines, but I don't know
whether that will impact RB's diff viewer...
chipx86
#1 chipx86
I can't reproduce this. Got an example or test case?
chipx86
#2 chipx86
I take that back. Looking into it now.
chipx86
#3 chipx86
  • +Fixed