From 36c5642b03efafd99ecb2cd4f80a49717ada7c8b Mon Sep 17 00:00:00 2001 From: vinaykumargujja Date: Mon, 23 Oct 2023 13:42:55 +0530 Subject: [PATCH] cleared lint issues imageshyperlink3 --- blocks/imageshyperlink/imageshyperlink.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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);