mirror of
https://github.com/zulip/zulip.git
synced 2025-11-13 10:26:28 +00:00
html_diff: Migrate from Text to str.
This commit is contained in:
committed by
Tim Abbott
parent
c863bb83a0
commit
d140451fb4
@@ -1,14 +1,14 @@
|
||||
import lxml
|
||||
|
||||
from lxml.html.diff import htmldiff
|
||||
from typing import Optional, Text
|
||||
from typing import Optional
|
||||
|
||||
def highlight_with_class(text, klass):
|
||||
# type: (Text, Text) -> Text
|
||||
# type: (str, str) -> str
|
||||
return '<span class="%s">%s</span>' % (klass, text)
|
||||
|
||||
def highlight_html_differences(s1, s2, msg_id=None):
|
||||
# type: (Text, Text, Optional[int]) -> Text
|
||||
# type: (str, str, Optional[int]) -> str
|
||||
retval = htmldiff(s1, s2)
|
||||
fragment = lxml.html.fromstring(retval) # type: ignore # https://github.com/python/typeshed/issues/525
|
||||
|
||||
|
||||
Reference in New Issue
Block a user