Fix HTML inside code blocks being rendered

This commit is contained in:
Lim Chee Aun 2022-12-26 18:04:49 +08:00
parent 082a04c30c
commit 334584ecef

View file

@ -39,7 +39,7 @@ function enhanceContent(content, opts = {}) {
const pre = document.createElement('pre');
// Replace <br /> with newlines
block.querySelectorAll('br').forEach((br) => br.replaceWith('\n'));
pre.innerHTML = `<code>${block.innerText.trim()}</code>`;
pre.innerHTML = `<code>${block.innerHTML.trim()}</code>`;
block.replaceWith(pre);
});