#1719 Clear text nodes in rendered formulas

This commit is contained in:
Cohee 2024-01-21 17:27:09 +02:00
parent e2becdf7a9
commit 814ed49c31
1 changed files with 11 additions and 1 deletions

View File

@ -60,6 +60,16 @@ const observer = new MutationObserver(function (mutations) {
RA_checkOnlineStatus();
} else if (mutation.target.parentNode === SelectedCharacterTab) {
setTimeout(RA_CountCharTokens, 200);
} else if (mutation.target.classList.contains('mes_text')) {
if (mutation.target instanceof HTMLElement) {
for (const element of mutation.target.getElementsByTagName('math')) {
element.childNodes.forEach(function (child) {
if (child.nodeType === Node.TEXT_NODE) {
child.textContent = '';
}
});
}
}
}
});
});
@ -1006,7 +1016,7 @@ export function initRossMods() {
<input type="checkbox" id="regenerateWithCtrlEnter">
Don't ask again
</label>`;
callPopup(popupText, 'confirm').then(result =>{
callPopup(popupText, 'confirm').then(result => {
if (!result) {
return;
}