Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Featured Image component in Topics - h3 seen as h2 #535

Merged
merged 2 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tools/actions/convert/test/fixtures/blog.html
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@

<div class="featureimage">

<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>
<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>
" descsize="tbase" btnnewtab="_self">
</feature-image>
</div>
Expand Down
2 changes: 1 addition & 1 deletion tools/actions/convert/test/fixtures/blog6.html
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@

<div class="featureimage">

<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>
<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>
" descsize="tbase" btnnewtab="_self">
</feature-image>
</div>
Expand Down
2 changes: 1 addition & 1 deletion tools/actions/convert/test/fixtures/product-topic.html
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@

<div class="featureimage">

<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>
<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>
" descsize="tbase" btnnewtab="_self">
</feature-image>
</div>
Expand Down
2 changes: 1 addition & 1 deletion tools/actions/convert/test/fixtures/product1.html
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ <h1 class="text-gray-900 my-2 font-semibold text-xl pt-0 pb-0">PRODUCT SPOTLIGHT

<div class="featureimage">

<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>
<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>
" descsize="txl" btntext="Learn More" btnhref="https://stage.lifesciences.danaher.com/us/en/products/family/intabio-zt-systems.html" btnnewtab="_self">
</feature-image>
</div>
Expand Down
3 changes: 2 additions & 1 deletion tools/importer/transformers/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ export const mapTable = (table, document) => {
export const featureimage = (featureImg, document) => {
const featureImageEL = featureImg?.querySelector('feature-image');
if (featureImageEL?.getAttribute('title')) {
const title = document.createElement('h2');
const headingTag = featureImageEL?.getAttribute('titleheading');
const title = headingTag ? document.createElement(headingTag) : document.createElement('h2');
title.textContent = featureImageEL.getAttribute('title');
featureImg.append(title);
}
Expand Down