diff --git a/tools/importer/transformers/index.js b/tools/importer/transformers/index.js index bf246b46..e1e33026 100644 --- a/tools/importer/transformers/index.js +++ b/tools/importer/transformers/index.js @@ -46,6 +46,7 @@ import stats from './stats.js'; import workflowCarousel from './workflowCarousel.js'; import embedScript from './embedScript.js'; import callToActionText from './callToActionText.js'; +import productNotFound from './product-not-found.js'; // eslint-disable-next-line import/prefer-default-export export const transformers = [ @@ -91,6 +92,7 @@ export const transformers = [ workflowCarousel, embedScript, callToActionText, + productNotFound, ]; export const asyncTransformers = [ diff --git a/tools/importer/transformers/product-not-found.js b/tools/importer/transformers/product-not-found.js new file mode 100644 index 00000000..bdd83833 --- /dev/null +++ b/tools/importer/transformers/product-not-found.js @@ -0,0 +1,10 @@ +/* global WebImporter */ +const productNotFound = (main, document) => { + const notFoundEl = main.querySelector('div#product-not-found'); + if (notFoundEl) { + const block = [['Product not found'], ['']]; + const table = WebImporter.DOMUtils.createTable(block, document); + notFoundEl.replaceWith(table); + } +}; +export default productNotFound;