Fix avatar text issue in rte (#10559)
* replace - with zwsp * improve comments * fix broken tests * fix typo
This commit is contained in:
parent
29780704f1
commit
96c62ea03d
2 changed files with 8 additions and 6 deletions
|
@ -89,12 +89,14 @@ export function getMentionDisplayText(completion: ICompletion, client: MatrixCli
|
|||
*
|
||||
* @param completion - the item selected from the autocomplete
|
||||
* @param client - the MatrixClient is required for us to look up the correct room mention text
|
||||
* @returns an object of attributes containing HTMLAnchor attributes or data-* attri
|
||||
* @returns an object of attributes containing HTMLAnchor attributes or data-* attributes
|
||||
*/
|
||||
export function getMentionAttributes(completion: ICompletion, client: MatrixClient, room: Room): Attributes {
|
||||
// to ensure that we always have something set in the --avatar-letter CSS variable
|
||||
// as otherwise alignment varies depending on whether the content is empty or not
|
||||
const defaultLetterContent = "-";
|
||||
// To ensure that we always have something set in the --avatar-letter CSS variable
|
||||
// as otherwise alignment varies depending on whether the content is empty or not.
|
||||
|
||||
// Use a zero width space so that it counts as content, but does not display anything.
|
||||
const defaultLetterContent = "\u200b";
|
||||
|
||||
if (completion.type === "user") {
|
||||
// logic as used in UserPillPart.setAvatar in parts.ts
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue