]> git.scottworley.com Git - paperdoorknob/blobdiff - texfilter.py
Handle Unicode characters ≈ and ◁
[paperdoorknob] / texfilter.py
index de3674b82f04a414cec9e7323ca41b8d8f0d1938..e215b185ff946dd1b849163dd0032094c61bfc3a 100644 (file)
@@ -13,6 +13,8 @@ TexFilters: List[Tuple[str, Callable[[bytes], bytes]]] = [
     # Work around `Extra }, or forgotten \endgroup.`
     ("FixBareNesting", lambda x: re.sub(
         b'(^|\n)(\\\\(emph|st){)', b'\\1\\\\hspace{0pt}\\2', x)),
+    ("UnicodeApprox", lambda x: re.sub('≈'.encode('utf-8'), b'$\\approx$', x)),
+    ("UnicodeTriangle", lambda x: re.sub('◁'.encode('utf-8'), b'$\\lhd$', x)),
 ]