diff --git a/code/websites/pokedex.online/src/directives/highlight.js b/code/websites/pokedex.online/src/directives/highlight.js index 37d2b90..984d471 100644 --- a/code/websites/pokedex.online/src/directives/highlight.js +++ b/code/websites/pokedex.online/src/directives/highlight.js @@ -10,6 +10,11 @@ import json from 'highlight.js/lib/languages/json'; // Register JSON language hljs.registerLanguage('json', json); +// Configure highlight.js to suppress HTML warnings (our content is safe/internal) +hljs.configure({ + ignoreUnescapedHTML: true +}); + /** * Apply syntax highlighting to a code element * @param {HTMLElement} el - The code element to highlight @@ -22,8 +27,6 @@ function applyHighlight(el, theme = 'github-dark') { } try { - // Configure highlight.js to handle HTML safely - hljs.configure({ useBR: false }); hljs.highlightElement(el); // Remove any existing theme classes el.className = el.className.replace(/hljs-theme-\w+/, '');