colors: Handle the <p> tag.

This commit is contained in:
Damir Jelić 2018-08-08 20:42:16 +02:00
parent 8597dbbf52
commit 94330922eb

View file

@ -389,6 +389,12 @@ class MatrixHtmlParser(HTMLParser):
self._toggle_attribute("strikethrough") self._toggle_attribute("strikethrough")
elif tag == "blockquote": elif tag == "blockquote":
self._toggle_attribute("quote") self._toggle_attribute("quote")
elif tag == "p":
if self.text:
self.add_substring(self.text, self.attributes.copy())
self.text = "\n"
self.add_substring(self.text, DEFAULT_ATRIBUTES.copy())
self.text = ""
elif tag == "font": elif tag == "font":
if self.text: if self.text:
self.add_substring(self.text, self.attributes.copy()) self.add_substring(self.text, self.attributes.copy())