Skip to content

Commit db2a157

Browse files
Merge pull request #535 from hlxsites/534-topics-page-h3-seen-as-h2
Featured Image component in Topics - h3 seen as h2
2 parents 016fd9f + 8f07c53 commit db2a157

File tree

5 files changed

+6
-5
lines changed

5 files changed

+6
-5
lines changed

tools/actions/convert/test/fixtures/blog.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@
483483

484484
<div class="featureimage">
485485

486-
<feature-image textwidth="_self" title="Key Takeaway Text Example:" titlesize="xl" titleheading="h1" description="&lt;p>The most important thing to consider for your experiment is keeping your sample alive and healthy during sample preparation and imaging. Thus, it is critical to maintain the sample in an environment that resembles as closely as possible physiological conditions, i.e., temperature, pH, oxygen levels, and other important factors.&lt;/p>
486+
<feature-image textwidth="_self" title="Key Takeaway Text Example:" titlesize="xl" titleheading="h2" description="&lt;p>The most important thing to consider for your experiment is keeping your sample alive and healthy during sample preparation and imaging. Thus, it is critical to maintain the sample in an environment that resembles as closely as possible physiological conditions, i.e., temperature, pH, oxygen levels, and other important factors.&lt;/p>
487487
" descsize="tbase" btnnewtab="_self">
488488
</feature-image>
489489
</div>

tools/actions/convert/test/fixtures/blog6.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@
396396

397397
<div class="featureimage">
398398

399-
<feature-image textwidth="_self" title="Key Takeaway Text Example:" titlesize="xl" titleheading="h1" description="&lt;p>The most important thing to consider for your experiment is keeping your sample alive and healthy during sample preparation and imaging. Thus, it is critical to maintain the sample in an environment that resembles as closely as possible physiological conditions, i.e., temperature, pH, oxygen levels, and other important factors.&lt;/p>
399+
<feature-image textwidth="_self" title="Key Takeaway Text Example:" titlesize="xl" titleheading="h2" description="&lt;p>The most important thing to consider for your experiment is keeping your sample alive and healthy during sample preparation and imaging. Thus, it is critical to maintain the sample in an environment that resembles as closely as possible physiological conditions, i.e., temperature, pH, oxygen levels, and other important factors.&lt;/p>
400400
" descsize="tbase" btnnewtab="_self">
401401
</feature-image>
402402
</div>

tools/actions/convert/test/fixtures/product-topic.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@
398398

399399
<div class="featureimage">
400400

401-
<feature-image textwidth="_self" title="Key Takeaway Text Example:" titlesize="xl" titleheading="h1" description="&lt;p>The most important thing to consider for your experiment is keeping your sample alive and healthy during sample preparation and imaging. Thus, it is critical to maintain the sample in an environment that resembles as closely as possible physiological conditions, i.e., temperature, pH, oxygen levels, and other important factors.&lt;/p>
401+
<feature-image textwidth="_self" title="Key Takeaway Text Example:" titlesize="xl" titleheading="h2" description="&lt;p>The most important thing to consider for your experiment is keeping your sample alive and healthy during sample preparation and imaging. Thus, it is critical to maintain the sample in an environment that resembles as closely as possible physiological conditions, i.e., temperature, pH, oxygen levels, and other important factors.&lt;/p>
402402
" descsize="tbase" btnnewtab="_self">
403403
</feature-image>
404404
</div>

tools/actions/convert/test/fixtures/product1.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ <h1 class="text-gray-900 my-2 font-semibold text-xl pt-0 pb-0">PRODUCT SPOTLIGHT
725725

726726
<div class="featureimage">
727727

728-
<feature-image textwidth="_self" title="Intabio ZT System" titlesize="xxxl" titleheading="h1" description="&lt;p>Comprehensive charge variant analysis made simple. The Intabio ZT system couples icIEF separation and UV detection with high resolution mass spectrometry on the ZenoTOF 7600 system&lt;/p>
728+
<feature-image textwidth="_self" title="Intabio ZT System" titlesize="xxxl" titleheading="h2" description="&lt;p>Comprehensive charge variant analysis made simple. The Intabio ZT system couples icIEF separation and UV detection with high resolution mass spectrometry on the ZenoTOF 7600 system&lt;/p>
729729
" descsize="txl" btntext="Learn More" btnhref="https://stage.lifesciences.danaher.com/us/en/products/family/intabio-zt-systems.html" btnnewtab="_self">
730730
</feature-image>
731731
</div>

tools/importer/transformers/util.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ export const mapTable = (table, document) => {
6161
export const featureimage = (featureImg, document) => {
6262
const featureImageEL = featureImg?.querySelector('feature-image');
6363
if (featureImageEL?.getAttribute('title')) {
64-
const title = document.createElement('h2');
64+
const headingTag = featureImageEL?.getAttribute('titleheading');
65+
const title = headingTag ? document.createElement(headingTag) : document.createElement('h2');
6566
title.textContent = featureImageEL.getAttribute('title');
6667
featureImg.append(title);
6768
}

0 commit comments

Comments
 (0)