diff options
-rw-r--r-- | watchnews/web.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/watchnews/web.py b/watchnews/web.py index ab87018..c687120 100644 --- a/watchnews/web.py +++ b/watchnews/web.py @@ -1,7 +1,7 @@ from . import data, css from ll.xist import xsc, parse -from ll.xist.ns import html +from ll.xist.ns import html, chars from flask import Flask, url_for import re @@ -24,8 +24,10 @@ class DiffSupport: in_change = False for ((line1, diff1), (line2, diff2), flag) in diff: if flag ^ in_change: - rows.append(html.tr(html.td(' '.join('↔' * 10)), - html.td(' '.join('↔' * 10)))) + if flag: symbol = '↓' + else: symbol = '↑' + rows.append(html.tr(html.td(' '.join(symbol * 10)), + html.td(' '.join(symbol * 10)))) in_change = flag rows.append(html.tr( html.td(*self._format_diff(diff1)), @@ -64,6 +66,8 @@ class DiffSupport: if line != '': # trailing unchanged text elems += [html.span(line)] + + elems += [ html.br() ] return elems |