Use resourceId in formatted body

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
pull/21833/head
Šimon Brandner 2021-03-11 08:29:03 +01:00
parent 0343a3337d
commit 62fa60f109
No known key found for this signature in database
GPG Key ID: 9760693FDD98A790
1 changed files with 4 additions and 0 deletions

View File

@ -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)})`;