mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
don't accept closing parenthesis as last character of url
This commit is contained in:
parent
59a74dbd9f
commit
62bb891e79
@ -96,6 +96,12 @@ export function tests() {
|
||||
}
|
||||
},
|
||||
|
||||
"Link doesn't adopt closing parenthesis": assert => {
|
||||
const link = "(https://matrix.org)";
|
||||
const out = [{ type: "text", text: "(" }, { type: "link", text: "https://matrix.org" }, { type: "text", text: ")" }];
|
||||
test(assert, link, out);
|
||||
},
|
||||
|
||||
"Unicode in hostname must not linkify": assert => {
|
||||
const link = "https://foo.bar\uD83D\uDE03.com";
|
||||
const out = [{ type: "link", text: "https://foo.bar" },
|
||||
|
@ -4,7 +4,7 @@ meaning that any escapes (\) must also
|
||||
be escaped.
|
||||
*/
|
||||
const scheme = "(?:https|http|ftp):\\/\\/";
|
||||
const noSpaceNorPunctuation = "[^\\s.,?!]";
|
||||
const noSpaceNorPunctuation = "[^\\s.,?!)]";
|
||||
const hostCharacter = "[a-zA-Z0-9:.\\[\\]-]";
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user