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.
This commit is contained in:
Denis Kasak 2019-01-11 22:30:32 +01:00
parent 11b960e22c
commit a8ea6504e9

View file

@ -200,7 +200,7 @@ class Formatted(object):
text = text + line[i] text = text + line[i]
i = i + 1 i = i + 1
substrings.append(FormattedString(text, attributes)) substrings.append(FormattedString(text, DEFAULT_ATTRIBUTES.copy()))
return cls(substrings) return cls(substrings)
@classmethod @classmethod