Skip to content

Commit

Permalink
fix mention url is encoded wrong (#1936)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajbura committed Sep 8, 2024
1 parent 388f606 commit 4dfce32
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/components/editor/output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const elementToCustomHtml = (node: CustomElement, children: string): string => {
}

const matrixTo = `https://matrix.to/#/${fragment}`;
return `<a href="${encodeURIComponent(matrixTo)}">${sanitizeText(node.name)}</a>`;
return `<a href="${encodeURI(matrixTo)}">${sanitizeText(node.name)}</a>`;
}
case BlockType.Emoticon:
return node.key.startsWith('mxc://')
Expand All @@ -71,7 +71,7 @@ const elementToCustomHtml = (node: CustomElement, children: string): string => {
)}" title="${sanitizeText(node.shortcode)}" height="32" />`
: sanitizeText(node.key);
case BlockType.Link:
return `<a href="${encodeURIComponent(node.href)}">${node.children}</a>`;
return `<a href="${encodeURI(node.href)}">${node.children}</a>`;
case BlockType.Command:
return `/${sanitizeText(node.command)}`;
default:
Expand Down

0 comments on commit 4dfce32

Please sign in to comment.