diff --git a/matrix/colors.py b/matrix/colors.py index 14f047a..3944286 100644 --- a/matrix/colors.py +++ b/matrix/colors.py @@ -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