Skip to content

Commit

Permalink
Minor change wrt to null check
Browse files Browse the repository at this point in the history
  • Loading branch information
piyushjindal committed Oct 3, 2023
1 parent 560e7cb commit 4b0cf20
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tools/importer/import-news-press-healthythinking.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,14 @@ const createFragmentBlockFromSection = (document) => {
block.push(['https://main--sunstar--hlxsites.hlx.page/fragments/featured-articles']);
section = newsPressCard;
}
const table = WebImporter.DOMUtils.createTable(block, document);
section.before(document.createElement('hr'));
section.before(document.querySelector('.slider-title'));
section.after(document.createElement('hr'));
section.replaceWith(table);

if (section) {
const table = WebImporter.DOMUtils.createTable(block, document);
section.before(document.createElement('hr'));
section.before(document.querySelector('.slider-title'));
section.after(document.createElement('hr'));
section.replaceWith(table);
}
};

const addSocialBlock = (document) => {
Expand Down

0 comments on commit 4b0cf20

Please sign in to comment.