]> git.scottworley.com Git - paperdoorknob/blobdiff - texify.py
Support _ in URLs
[paperdoorknob] / texify.py
index 83a8c671087d47fee49e25553be568032cf2f2c5..65b4230bc135db2cea845c7ae25e48be8e57f25a 100644 (file)
--- a/texify.py
+++ b/texify.py
@@ -49,6 +49,9 @@ class DirectTexifier(Texifier):
     def texify(self, html: Tag) -> bytes:
         if html.name == 'em':
             return b'\\emph{' + self._texify_children(html).strip() + b'}\n'
+        if html.name == 'a' and 'href' in html.attrs:
+            return b'\\href{' + html.attrs['href'].encode(
+                'UTF-8') + b'}{' + self._texify_children(html).strip() + b'}\n'
         return self._texify_children(html)