mirror of
https://github.com/SableClient/Sable.git
synced 2026-11-28 04:46:28 -08:00
formatting
This commit is contained in:
1 parent
7785d91f97
commit
f92e68a658
1 file changed
+5
-8
@@ -66,14 +66,11 @@ const shieldBareMatrixToLinks = (
|
||||
const placeholders = new Map<string, string>();
|
||||
let index = 0;
|
||||
|
||||
const shielded = input.replace(
|
||||
/(?<!\]\()https?:\/\/matrix\.to\/[^\s<)]+/gi,
|
||||
(url) => {
|
||||
const key = `${MATRIX_TO_PLACEHOLDER_PREFIX}${index++}X`;
|
||||
placeholders.set(key, url);
|
||||
return key;
|
||||
}
|
||||
);
|
||||
const shielded = input.replace(/(?<!\]\()https?:\/\/matrix\.to\/[^\s<)]+/gi, (url) => {
|
||||
const key = `${MATRIX_TO_PLACEHOLDER_PREFIX}${index++}X`;
|
||||
placeholders.set(key, url);
|
||||
return key;
|
||||
});
|
||||
|
||||
return { shielded, placeholders };
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user