From 0a7beb66075a18093a929984bba8c05e2292eb54 Mon Sep 17 00:00:00 2001 From: Megan Thomas Date: Mon, 9 Sep 2024 16:04:36 -0700 Subject: [PATCH] MWPW-144470 Remove author link from article header --- blog/scripts/utils.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/blog/scripts/utils.js b/blog/scripts/utils.js index 32afb0c..f0e9e86 100644 --- a/blog/scripts/utils.js +++ b/blog/scripts/utils.js @@ -64,7 +64,7 @@ function buildBlock(blockName, content) { function getImageCaption(picture) { // Check if the parent element has a caption const parentEl = picture.parentNode; - let caption = parentEl.querySelector('em'); + const caption = parentEl.querySelector('em'); if (caption) return caption; // If the parent element doesn't have a caption, check if the next sibling does @@ -72,6 +72,7 @@ function getImageCaption(picture) { if (!parentSiblingEl || !parentSiblingEl.querySelector('picture')) return ''; const firstChildEl = parentSiblingEl.firstChild; if (firstChildEl?.tagName === 'EM') return firstChildEl; + return ''; } async function buildArticleHeader(el) { @@ -90,7 +91,7 @@ async function buildArticleHeader(el) { const articleHeaderBlockEl = buildBlock('article-header', [ ['

'], [h1], - [`

${authorURL ? `${author}` : author}

+ [`

${author}

${publicationDate}

`], [figure], ]);