[diffoscope] 02/02: Remove useless <span>s in HTML output
Jérémy Bobbio
lunar at moszumanska.debian.org
Wed Dec 16 11:14:21 CET 2015
This is an automated email from the git hooks/post-receive script.
lunar pushed a commit to branch master
in repository diffoscope.
commit 9b36809902f17afabfaa32b48f6ba0c7bec26e70
Author: Jérémy Bobbio <lunar at debian.org>
Date: Wed Dec 16 10:11:35 2015 +0000
Remove useless <span>s in HTML output
We used to output a lot of '<span class="diffchanged2">' with just one letter
followed by the exact same span for the next character if it wass still
different. Not very efficient. So let's group changed characters together.
Thanks Mike Hommey for noticing the problem. I guess more optimizations could
be done, but that'll be for another time.
Closes: #808121
---
diffoscope/presenters/html.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/diffoscope/presenters/html.py b/diffoscope/presenters/html.py
index 957b48f..d843f39 100644
--- a/diffoscope/presenters/html.py
+++ b/diffoscope/presenters/html.py
@@ -271,7 +271,7 @@ def linediff(s, t):
l1.append(s[fx])
l2.append(t[fy])
- return ''.join(l1), ''.join(l2)
+ return ''.join(l1).replace(DIFFOFF + DIFFON, ''), ''.join(l2).replace(DIFFOFF + DIFFON, '')
def convert(s, ponct=0):
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git
More information about the diffoscope
mailing list