From 42447dd95273d9f77b0795a83ae275e3637f8bc2 Mon Sep 17 00:00:00 2001 From: FragginWagon Date: Wed, 28 Jan 2026 20:25:27 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Configure=20highlight.js=20to=20sup?= =?UTF-8?q?press=20HTML=20warnings=20and=20remove=20redundant=20configurat?= =?UTF-8?q?ion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/websites/pokedex.online/src/directives/highlight.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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+/, '');