Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 7c8c851

Browse files
authored
Merge pull request #5748 from SimonBrandner/compat-for-non-rich-text-clients
Show room alias in plain/formatted body
2 parents 9ac5f4d + d4f67d9 commit 7c8c851

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/editor/serialize.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ export function mdSerialize(model: EditorModel) {
3434
case "at-room-pill":
3535
return html + part.text;
3636
case "room-pill":
37+
// Here we use the resourceId for compatibility with non-rich text clients
38+
// See https://github.com/vector-im/element-web/issues/16660
39+
return html +
40+
`[${part.resourceId.replace(/[[\\\]]/g, c => "\\" + c)}](${makeGenericPermalink(part.resourceId)})`;
3741
case "user-pill":
3842
return html +
3943
`[${part.text.replace(/[[\\\]]/g, c => "\\" + c)}](${makeGenericPermalink(part.resourceId)})`;
@@ -97,6 +101,9 @@ export function textSerialize(model: EditorModel) {
97101
case "at-room-pill":
98102
return text + part.text;
99103
case "room-pill":
104+
// Here we use the resourceId for compatibility with non-rich text clients
105+
// See https://github.com/vector-im/element-web/issues/16660
106+
return text + `${part.resourceId}`;
100107
case "user-pill":
101108
return text + `${part.text}`;
102109
}

0 commit comments

Comments
 (0)