matrix: URIs #112

Merged
cadence merged 8 commits from mschae/out-of-your-element:matrix-uris into main 2026-11-28 03:44:30 +00:00
Showing only changes of commit 3e080e8187 - Show all commits

add % to the matrix: uri regex

in case someone (sable) decides to percent-encode the id for some reason
mini-bomba 2026-11-19 21:51:12 +01:00
No known key found for this signature in database
GPG key ID: 30F8B138B4794886

View file

@ -564,7 +564,7 @@ function serialiseReplyContent(doc) {
* @returns {string} * @returns {string}
*/ */
function convertMatrixUris(input) { function convertMatrixUris(input) {
return input.replace(/(?<![\/:@?#])\b(matrix:[\w\/=?:\.&-]+)/gi, (match, uri) => { return input.replace(/(?<![\/:@?#])\b(matrix:[\w\/=?:\.&%-]+)/gi, (match, uri) => {
// technically the url might be html-encoded, but since we're gonna splice the url back together, // technically the url might be html-encoded, but since we're gonna splice the url back together,
// and none of the characters that might get html-encoded are actually important to us, it doesn't really matter // and none of the characters that might get html-encoded are actually important to us, it doesn't really matter
// (most of the case it's the query string, and we just copy it over anyway) // (most of the case it's the query string, and we just copy it over anyway)