From 37b6162c2550eadec74dfb93cc54cdedc58fe274 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Thu, 11 Mar 2021 08:29:03 +0100 Subject: [PATCH] Use resourceId in formatted body MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/editor/serialize.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/editor/serialize.ts b/src/editor/serialize.ts index c1f4da306b..40ff4b59f5 100644 --- a/src/editor/serialize.ts +++ b/src/editor/serialize.ts @@ -34,6 +34,10 @@ export function mdSerialize(model: EditorModel) { case "at-room-pill": return html + part.text; case "room-pill": + // Here we use the resourceId for compatibility with non-rich text clients + // See https://github.com/vector-im/element-web/issues/16660 + return html + + `[${part.resourceId.replace(/[[\\\]]/g, c => "\\" + c)}](${makeGenericPermalink(part.resourceId)})`; case "user-pill": return html + `[${part.text.replace(/[[\\\]]/g, c => "\\" + c)}](${makeGenericPermalink(part.resourceId)})`;