def make_diff(old, new):
"""
Render in HTML the diff between two texts
"""
df = HtmlDiff()
old_lines = old.splitlines(1)
new_lines = new.splitlines(1)
html = df.make_table(old_lines, new_lines, context=True)
html = html.replace(' nowrap="nowrap"','')
return html
评论列表
文章目录