Forráskód Böngészése

:art: fix https://github.com/Vanessa219/vditor/issues/1560

Vanessa 1 éve
szülő
commit
f8d078a851
1 módosított fájl, 4 hozzáadás és 3 törlés
  1. 4 3
      src/ts/wysiwyg/index.ts

+ 4 - 3
src/ts/wysiwyg/index.ts

@@ -424,11 +424,12 @@ class WYSIWYG {
             }
 
             // 打开链接
-            if (event.target.tagName === "A") {
+            const a = hasClosestByMatchTag(event.target, "A");
+            if (a) {
                 if (vditor.options.link.click) {
-                    vditor.options.link.click(event.target);
+                    vditor.options.link.click(a);
                 } else if (vditor.options.link.isOpen) {
-                    window.open(event.target.getAttribute("href"));
+                    window.open(a.getAttribute("href"));
                 }
                 event.preventDefault();
                 return;