Fix escaped markdown passing backslashes through

Fixes https://github.com/vector-im/riot-web/issues/11230

Signed-off-by: Bob Rao <bob+git@vulpin.com>
This commit is contained in:
BobVul 2020-01-31 12:33:10 +11:00
parent 6f6d6b096a
commit fde30577e4
2 changed files with 10 additions and 0 deletions

View file

@ -41,6 +41,10 @@ export function htmlSerializeIfNeeded(model, {forceHTML = false} = {}) {
if (!parser.isPlainText() || forceHTML) {
return parser.toHTML();
}
// Format "plain" text to ensure removal of backslash escapes
// https://github.com/vector-im/riot-web/issues/11230
// https://github.com/vector-im/riot-web/issues/2870
return parser.toPlaintext();
}
export function textSerialize(model) {