Внешние ссылки: открывать только http(s) и mailto
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user