fix: refreshing mermaid theme may fail (#2113)

This commit is contained in:
Cotes Chung 2024-12-12 01:24:37 +08:00 committed by GitHub
parent 0360c9e90b
commit 2f00d41861
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -11,7 +11,7 @@ function refreshTheme(event) {
const mermaidList = document.getElementsByClassName(MERMAID);
[...mermaidList].forEach((elem) => {
const svgCode = elem.previousSibling.children.item(0).innerHTML;
const svgCode = elem.previousSibling.children.item(0).textContent;
elem.textContent = svgCode;
elem.removeAttribute('data-processed');
});