mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-02 14:16:39 +01:00
Fix HTML inside code blocks being rendered
This commit is contained in:
parent
082a04c30c
commit
334584ecef
1 changed files with 1 additions and 1 deletions
|
@ -39,7 +39,7 @@ function enhanceContent(content, opts = {}) {
|
||||||
const pre = document.createElement('pre');
|
const pre = document.createElement('pre');
|
||||||
// Replace <br /> with newlines
|
// Replace <br /> with newlines
|
||||||
block.querySelectorAll('br').forEach((br) => br.replaceWith('\n'));
|
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);
|
block.replaceWith(pre);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue