don't accept closing parenthesis as last character of url
This commit is contained in:
parent
59a74dbd9f
commit
62bb891e79
2 changed files with 7 additions and 1 deletions
|
@ -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 => {
|
"Unicode in hostname must not linkify": assert => {
|
||||||
const link = "https://foo.bar\uD83D\uDE03.com";
|
const link = "https://foo.bar\uD83D\uDE03.com";
|
||||||
const out = [{ type: "link", text: "https://foo.bar" },
|
const out = [{ type: "link", text: "https://foo.bar" },
|
||||||
|
|
|
@ -4,7 +4,7 @@ meaning that any escapes (\) must also
|
||||||
be escaped.
|
be escaped.
|
||||||
*/
|
*/
|
||||||
const scheme = "(?:https|http|ftp):\\/\\/";
|
const scheme = "(?:https|http|ftp):\\/\\/";
|
||||||
const noSpaceNorPunctuation = "[^\\s.,?!]";
|
const noSpaceNorPunctuation = "[^\\s.,?!)]";
|
||||||
const hostCharacter = "[a-zA-Z0-9:.\\[\\]-]";
|
const hostCharacter = "[a-zA-Z0-9:.\\[\\]-]";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Reference in a new issue