Support more unnecessary room link percent-encodes

This commit is contained in:
Cadence Ember 2026-08-06 16:28:50 +12:00
commit 85b9e4743f

View file

@ -384,7 +384,7 @@ function linkEndOfMessageSpriteSheet(content) {
*/ */
async function handleRoomOrMessageLinks(input, di) { async function handleRoomOrMessageLinks(input, di) {
let offset = 0 let offset = 0
for (const match of [...input.matchAll(/("?https:\/\/matrix.to\/#\/((?:#|%23|!)[^"/, ?)]+)(?:\/(\$[^"/ ?)]+))?(?:\?[^",:!? )]*?)?)(">|[,<\n )]|$)/g)]) { for (const match of [...input.matchAll(/("?https:\/\/matrix.to\/#\/((?:#|%23|!|%21)[^"/, ?)]+)(?:\/((?:\$|%24)[^"/ ?)]+))?(?:\?[^",:!? )]*?)?)(">|[,<\n )]|$)/g)]) {
assert(typeof match.index === "number") assert(typeof match.index === "number")
let [_, attributeValue, roomID, eventID, endMarker] = match let [_, attributeValue, roomID, eventID, endMarker] = match
let result let result