mirror of https://github.com/zulip/zulip.git
html_diff: Migrate from `Text` to `str`.
This commit is contained in:
parent
c863bb83a0
commit
d140451fb4
|
@ -1,14 +1,14 @@
|
||||||
import lxml
|
import lxml
|
||||||
|
|
||||||
from lxml.html.diff import htmldiff
|
from lxml.html.diff import htmldiff
|
||||||
from typing import Optional, Text
|
from typing import Optional
|
||||||
|
|
||||||
def highlight_with_class(text, klass):
|
def highlight_with_class(text, klass):
|
||||||
# type: (Text, Text) -> Text
|
# type: (str, str) -> str
|
||||||
return '<span class="%s">%s</span>' % (klass, text)
|
return '<span class="%s">%s</span>' % (klass, text)
|
||||||
|
|
||||||
def highlight_html_differences(s1, s2, msg_id=None):
|
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)
|
retval = htmldiff(s1, s2)
|
||||||
fragment = lxml.html.fromstring(retval) # type: ignore # https://github.com/python/typeshed/issues/525
|
fragment = lxml.html.fromstring(retval) # type: ignore # https://github.com/python/typeshed/issues/525
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue