Merge pull request #5748 from SimonBrandner/compat-for-non-rich-text-clients
Show room alias in plain/formatted body
This commit is contained in:
commit
7c8c85161d
1 changed files with 7 additions and 0 deletions
|
@ -34,6 +34,10 @@ export function mdSerialize(model: EditorModel) {
|
||||||
case "at-room-pill":
|
case "at-room-pill":
|
||||||
return html + part.text;
|
return html + part.text;
|
||||||
case "room-pill":
|
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":
|
case "user-pill":
|
||||||
return html +
|
return html +
|
||||||
`[${part.text.replace(/[[\\\]]/g, c => "\\" + c)}](${makeGenericPermalink(part.resourceId)})`;
|
`[${part.text.replace(/[[\\\]]/g, c => "\\" + c)}](${makeGenericPermalink(part.resourceId)})`;
|
||||||
|
@ -97,6 +101,9 @@ export function textSerialize(model: EditorModel) {
|
||||||
case "at-room-pill":
|
case "at-room-pill":
|
||||||
return text + part.text;
|
return text + part.text;
|
||||||
case "room-pill":
|
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 text + `${part.resourceId}`;
|
||||||
case "user-pill":
|
case "user-pill":
|
||||||
return text + `${part.text}`;
|
return text + `${part.text}`;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue