diff --git a/blocks/imageshyperlink/imageshyperlink.js b/blocks/imageshyperlink/imageshyperlink.js index 730dcac2..0bc06fdd 100644 --- a/blocks/imageshyperlink/imageshyperlink.js +++ b/blocks/imageshyperlink/imageshyperlink.js @@ -7,9 +7,15 @@ export default async function decorate(block) { const refAnchorEl = block.querySelector('a'); const pic = block.querySelector('picture'); if (refAnchorEl) { - if(refAnchorEl.hasAttribute('href')) anchorEl.setAttribute('href', refAnchorEl.getAttribute('href')); - if(refAnchorEl.hasAttribute('title')) anchorEl.setAttribute('title', refAnchorEl.getAttribute('title')); - if(refAnchorEl.hasAttribute('alt')) anchorEl.setAttribute('alt', refAnchorEl.getAttribute('alt')); + if (refAnchorEl.hasAttribute('href')) { + anchorEl.setAttribute('href', refAnchorEl.getAttribute('href')); + } + if (refAnchorEl.hasAttribute('title')) { + anchorEl.setAttribute('title', refAnchorEl.getAttribute('title')); + } + if (refAnchorEl.hasAttribute('alt')) { + anchorEl.setAttribute('alt', refAnchorEl.getAttribute('alt')); + } anchorEl.appendChild(pic); block.textContent = ''; block.append(anchorEl);