fix: dompurify issue

Signed-off-by: mertmit <mertmit99@gmail.com>
This commit is contained in:
mertmit
2026-02-27 15:20:30 +05:30
parent dbde261b9d
commit e754b88d5b
8 changed files with 21 additions and 30 deletions

View File

@@ -35,15 +35,6 @@ function mdLinkRuleSetupExt(md: MarkdownIt, { openLinkOnClick = false }: { openL
if (relIndex < 0) {
tokens[idx]!.attrPush(['rel', 'noopener noreferrer nofollow'])
}
const onClickIndex = tokens[idx]!.attrIndex('onmousedown')
if (onClickIndex < 0) {
tokens[idx]!.attrPush(['onmousedown', '(function(event) { event.preventDefault();})(event)'])
}
const clickIndex = tokens[idx]!.attrIndex('onclick')
if (clickIndex < 0) {
tokens[idx]!.attrPush(['onclick', '(function(event) { window.tiptapLinkHandler?.(event);})(event)'])
}
}
return self.renderToken(tokens, idx, options)