Don't automatically add mentions for incomplete &/@/% links.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4328 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
Cory McWilliams 2023-06-17 14:30:17 +00:00
parent 48c47f097a
commit f018c367ed

View File

@ -37,6 +37,11 @@ class TfComposeElement extends LitElement {
for (let match of text.matchAll(/\[([^\[]+)]\(([@&%][^\)]+)/g)) {
let name = match[1];
let link = match[2];
if ((link.startsWith('&') && link.length != 52) ||
(link.startsWith('@') && link.length != 53) ||
(link.startsWith('%') && link.length != 52)) {
continue;
}
let balance = 0;
let bracket_end = match.index + match[1].length + '[]'.length - 1;
for (let i = bracket_end; i >= 0; i--) {