mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2025-12-06 07:12:10 +01:00
Minor optimization after e976a5ddc7
This commit is contained in:
parent
263b5d5557
commit
d085dc6a93
|
|
@ -9,8 +9,12 @@ function toggleDarkMode() {
|
||||||
|
|
||||||
// Re-highlight all code blocks once stylesheet loads
|
// Re-highlight all code blocks once stylesheet loads
|
||||||
currentCSS.onload = function() {
|
currentCSS.onload = function() {
|
||||||
document.querySelectorAll("pre code").forEach(block => {
|
const messageBodies = document.getElementById("chat").querySelectorAll(".message-body");
|
||||||
hljs.highlightElement(block);
|
messageBodies.forEach((messageBody) => {
|
||||||
|
const codeBlocks = messageBody.querySelectorAll("pre code");
|
||||||
|
codeBlocks.forEach((codeBlock) => {
|
||||||
|
hljs.highlightElement(codeBlock);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue