From 24bf2ea85dc21f6ccd5baaea8316ed402da74fd3 Mon Sep 17 00:00:00 2001 From: Tim McMackin Date: Tue, 2 Jul 2024 13:13:44 -0400 Subject: [PATCH] Use className instead of class in MDX --- src/scripts/process_downloaded_glossary.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/scripts/process_downloaded_glossary.js b/src/scripts/process_downloaded_glossary.js index 6e52581ac..c0795bda1 100644 --- a/src/scripts/process_downloaded_glossary.js +++ b/src/scripts/process_downloaded_glossary.js @@ -97,11 +97,16 @@ const process_glossary = async () => { const imported_glossary = wrapper.window.document.querySelector('div#imported-glossary'); imported_glossary.appendChild(trimmed); + + // Convert to string and remove line breaks to prevent MDX processing from making them into paragraph tags let imported_glossary_str = imported_glossary.outerHTML; imported_glossary_str = imported_glossary_str.replace(/([^>])$\n/gm, '$1 '); imported_glossary_str = imported_glossary_str.replace(/>$\n/gm, '>'); + // Convert class to className because we're in MDX now + imported_glossary_str = imported_glossary_str.replaceAll('class="', 'className="'); + // Overwrite existing glossary.md file let outputString = '---\ntitle: Glossary\n---\n\n'; // Fix for anchor links taking you too far down the page