difflib.py -- rev 1.27
class - HtmlDiff
method - _make_line
line numbers 1370 thru 1371
was:
if len(text) <= 1:
text = ' '+text
should be:
if not text:
text = ' '
This code was intended to show an "add" highlight in
the case of inserted blank lines. It was originally
coded to look for lines of length 1 or less to
accomodate lines where the newline character is not
stripped off. The undesired effect is that lines
containing only one character (such as a open or close
{} for a 'c' function) that are in column zero get
represented with a space infront of it.
Since newlines are stripped before this code is
executed (a code change done after this logic was
written) the above fix eliminates the undesired effect
without sacrificing anything.
The test for this module will not break as a result of
this change. If it is desired, I can modify the test
to cover this code. It would involve adding a blank
line and possibly a one character line to the test
input and then rebaselining the output.
|