Внешние ссылки: открывать только http(s) и mailto

This commit is contained in:
crm-wiki agent
2026-10-13 13:29:47 +00:00
parent bf1c8632a9
commit dd6df1ab1d

View File

@@ -85,7 +85,7 @@ export function WikiEditor(props: {
if (!href) return false;
event.preventDefault();
if (isInternal(href)) void navigate(href);
else window.open(href, "_blank", "noopener,noreferrer");
else if (/^(https?:|mailto:)/i.test(href)) window.open(href, "_blank", "noopener,noreferrer");
return true;
},
handlePaste: (_view, event) => {