Escape manually entered html characters
Previously, the behaviour was inconsistent; if there was no other formatting, weechat-matrix doesn't send formatted_body, and Riot would display the message as-is. If there _was_ other formatting, formatted_body is sent without escaping of the HTML characters, so that Riot would interpret them as HTML. This makes both cases consistent, using the first behaviour.
This commit is contained in:
parent
126c55b3ea
commit
397acef2bd
1 changed files with 5 additions and 0 deletions
|
@ -335,6 +335,11 @@ class Formatted(object):
|
|||
text = formatted_string.text
|
||||
attributes = formatted_string.attributes.copy()
|
||||
|
||||
# Escape HTML tag characters
|
||||
text = text.replace("&", "&") \
|
||||
.replace("<", "<") \
|
||||
.replace(">", ">")
|
||||
|
||||
if attributes["code"]:
|
||||
if attributes["preformatted"]:
|
||||
# XXX: This can't really happen since there's no way of
|
||||
|
|
Loading…
Reference in a new issue