chiark / gitweb /
HTML formatting: support <i>.
authorSimon Tatham <anakin@pobox.com>
Thu, 14 Dec 2023 18:20:24 +0000 (18:20 +0000)
committerSimon Tatham <anakin@pobox.com>
Thu, 14 Dec 2023 18:20:24 +0000 (18:20 +0000)
Same as <em>, of course.

text.py

diff --git a/text.py b/text.py
index 378b5fcc0630129380e02b5488accbd2b60cb0ad..233c0f06469923d3197fe662685096067606a723 100644 (file)
--- a/text.py
+++ b/text.py
@@ -493,7 +493,7 @@ class HTMLParser(html.parser.HTMLParser):
             self.colourstack.append('s')
             return
 
-        if tag == "em":
+        if tag in {"em", "i"}:
             self.colourstack.append('_')
             return
 
@@ -513,7 +513,7 @@ class HTMLParser(html.parser.HTMLParser):
                 self.paras.append(Paragraph())
             return
 
-        if tag in {"a", "code", "strong", "em"}:
+        if tag in {"a", "code", "strong", "em", "i"}:
             self.colourstack.pop()
             return