From cc86fb116d1c6b603bffb30afdc1fab3a9933ee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=AF=E3=82=99=E3=82=A8=E3=83=B3=E3=80=80=E3=83=8B?= =?UTF-8?q?=E3=83=A3=E3=83=B3?= Date: Tue, 21 Nov 2023 13:38:28 +0900 Subject: [PATCH] fix: can not change hyperlink --- src/Hyperlink.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Hyperlink.js b/src/Hyperlink.js index a8d4142..7411d2e 100644 --- a/src/Hyperlink.js +++ b/src/Hyperlink.js @@ -315,10 +315,11 @@ export default class Hyperlink { let anchorTag = this.selection.findParentTag('A'); if (anchorTag) { this.selection.expandToTag(anchorTag); - }else{ - document.execCommand(this.commandLink, false, link); - anchorTag = this.selection.findParentTag('A'); } + + document.execCommand(this.commandLink, false, link) + anchorTag = this.selection.findParentTag(`A`) + if(anchorTag) { if(!!target) { anchorTag['target'] = target;