From a8ea6504e9b79aa431fcb09123fe6e50c4f24c97 Mon Sep 17 00:00:00 2001 From: Denis Kasak Date: Fri, 11 Jan 2019 22:30:32 +0100 Subject: [PATCH] Fix parsing of unclosed Markdown delimiters. Always append the last segment of the message with default attributes. This prevents unclosed Markdown delimiters from starting Markdown effects (for instance, `*foobar` won't display "foobar" as emphasized/italicised). Markdown parsing is still half-broken as it isn't a proper Markdown parser, but this improves the situation somewhat. --- matrix/colors.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matrix/colors.py b/matrix/colors.py index 3eeabb8..17e541f 100644 --- a/matrix/colors.py +++ b/matrix/colors.py @@ -200,7 +200,7 @@ class Formatted(object): text = text + line[i] i = i + 1 - substrings.append(FormattedString(text, attributes)) + substrings.append(FormattedString(text, DEFAULT_ATTRIBUTES.copy())) return cls(substrings) @classmethod