Skip to content
This repository has been archived by the owner on Aug 26, 2022. It is now read-only.

Commit

Permalink
bug 767537 - don't truncate tiny documents diffs
Browse files Browse the repository at this point in the history
  • Loading branch information
groovecoder committed Jul 5, 2012
1 parent 71f06fa commit 36f8717
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions apps/wiki/helpers.py
Expand Up @@ -54,8 +54,9 @@ def show_diff(seqm):
# and preceding lines for next change
context = context_lines[:lines] + ['<p>...</p>'] + context_lines[-lines:]
output = output + context
# remove extra context from the very end
output = output[:-lines]
# remove extra context from the very end, unless its the only context
if len(output) > lines+1: # context lines and the change line
output = output[:-lines]
return ''.join(output)

@register.function
Expand Down

0 comments on commit 36f8717

Please sign in to comment.