Skip to content

Commit

Permalink
Update scripts.js
Browse files Browse the repository at this point in the history
  • Loading branch information
kailasnadh790 committed Jan 12, 2024
1 parent 4cf1adc commit e023cc0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cigaradvisor/scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function buildArticleHeader(mainEl) {
imageWrapper.append(paragraph.querySelector('picture'));
}
const nextSibling = paragraph.nextElementSibling;
if (nextSibling && nextSibling.querySelector('em') !== null) {
if (nextSibling && nextSibling.tagName === 'P' && nextSibling.querySelector('em')) {
nextSibling.classList.add('article-image-caption');
imageWrapper.append(nextSibling);
}
Expand Down Expand Up @@ -151,7 +151,7 @@ async function loadFonts() {
function buildAutoBlocks(main) {
try {
const isHome = document.querySelector('body.homepage');
const isBlogPost = !!document.querySelector('body.blog-post-template');
const isBlogPost = document.querySelector('body.blog-post-template');
if (isHome) {
buildHeroBlock(main);
}
Expand Down

0 comments on commit e023cc0

Please sign in to comment.