Fix various UI bugs (#32821)

This commit is contained in:
wxiaoguang 2024-12-13 14:45:32 +08:00 committed by GitHub
parent 887928e0a6
commit 5bc030efa2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 47 additions and 30 deletions

View file

@ -1,9 +1,8 @@
import {displayError} from './common.ts';
function targetElement(el: Element) {
// The target element is either the current element if it has the
// `is-loading` class or the pre that contains it
return el.classList.contains('is-loading') ? el : el.closest('pre');
// The target element is either the parent "code block with loading indicator", or itself
return el.closest('.code-block.is-loading') ?? el;
}
export async function renderMath(): Promise<void> {