Title: Highlight JS Example

Problem statement: How do you add highlight.js to Anki cards?
Solution: document.querySelectorAll('pre code').forEach((block) => {
    // Replace HTML <br> with newline characters
    // https://stackoverflow.com/a/37815205/4738478
    block.innerHTML = block.innerHTML.replace(/<br\s*\/?>/gi,'\n');
    // Use highlight.js
    hljs.highlightElement(block);
});
Other fields (not shown on cards):
Problem name: Highlight.js Example