Skip to content

Commit d766696

Browse files
Track target changes
1 parent d0cf0a4 commit d766696

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

  • decidim-core/app/packs/src/decidim/editor/extensions/image

decidim-core/app/packs/src/decidim/editor/extensions/image/node_view.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ export default (self) => {
6464
currentHeight = null,
6565
currentHref = node.attrs.href,
6666
currentSrc = node.attrs.src,
67+
currentTarget = node.attrs.target,
6768
currentWidth = null,
6869
naturalHeight = img.naturalHeight,
6970
naturalWidth = img.naturalWidth,
@@ -186,11 +187,11 @@ export default (self) => {
186187
return false;
187188
}
188189

189-
const { alt, src, title, width, href } = updatedNode.attrs;
190+
const { alt, src, title, width, href, target } = updatedNode.attrs;
190191

191-
// If the href changed, we need to recreate the node because the structure
192-
// changes (wrapped in <a> vs not wrapped)
193-
if (href !== currentHref) {
192+
// If the href or target changed, we need to recreate the node because the
193+
// structure changes (wrapped in <a> vs not wrapped)
194+
if (href !== currentHref || target !== currentTarget) {
194195
return false;
195196
}
196197

0 commit comments

Comments
 (0)