diff --git a/mautrix_telegram/formatter/from_matrix/parser_htmlparser.py b/mautrix_telegram/formatter/from_matrix/parser_htmlparser.py index ad085fe9..464c3fae 100644 --- a/mautrix_telegram/formatter/from_matrix/parser_htmlparser.py +++ b/mautrix_telegram/formatter/from_matrix/parser_htmlparser.py @@ -14,7 +14,7 @@ # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -from typing import (Optional, List, Tuple, Type, Dict, Any, Deque, Match) +from typing import (Optional, List, Tuple, Type, Dict, Any, TYPE_CHECKING, Match) from html import unescape from html.parser import HTMLParser from collections import deque @@ -29,6 +29,9 @@ from ... import user as u, puppet as pu, portal as po from ..util import html_to_unicode from .parser_common import MatrixParserCommon, ParsedMessage +if TYPE_CHECKING: + from typing import Deque + def parse_html(html: str) -> ParsedMessage: parser = MatrixParser()