diff --git a/talon/quotations.py b/talon/quotations.py index d9dba21..f6122ff 100644 --- a/talon/quotations.py +++ b/talon/quotations.py @@ -164,6 +164,7 @@ RE_PARENTHESIS_LINK = re.compile("\(https?://") SPLITTER_MAX_LINES = 4 MAX_LINES_COUNT = 1000 +MAX_HTML_LEN = 2794202 QUOT_PATTERN = re.compile('^>+ ?') NO_QUOT_LINE = re.compile('^[^>].*[\S].*') @@ -382,6 +383,9 @@ def _extract_from_html(msg_body): then checking deleted checkpoints, then deleting necessary tags. """ + if len(msg_body) > MAX_HTML_LEN: + return msg_body + if msg_body.strip() == b'': return msg_body