From: Lady Date: Thu, 4 May 2023 03:12:11 +0000 (-0700) Subject: Add .hljs class to highlighted code X-Git-Url: https://git.ladys.computer/Blog/commitdiff_plain/4d65927738c9e46ed19d104e8153934e4d143535 Add .hljs class to highlighted code --- diff --git a/build.js b/build.js index 641bd94..d4e5d71 100755 --- a/build.js +++ b/build.js @@ -39,6 +39,10 @@ const applyHighlighting = (node) => { `${highlight}`, "text/html", ).documentElement.lastChild.childNodes; + code.setAttribute( + "class", + `hljs ${code.getAttribute("class")}`, + ); code.textContent = ""; for (const node of Array.from(nodes)) { code.appendChild(code.ownerDocument.importNode(node, true));