Skip to content

Commit

Permalink
Use className instead of class in MDX
Browse files Browse the repository at this point in the history
  • Loading branch information
timothymcmackin committed Jul 2, 2024
1 parent d994d61 commit 24bf2ea
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/scripts/process_downloaded_glossary.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 24bf2ea

Please sign in to comment.