mirror of
https://github.com/MathMan05/Fermi.git
synced 2026-08-28 22:08:19 +00:00
hopefully reduce flickering
This commit is contained in:
@@ -7,7 +7,14 @@ export async function highlight(
|
||||
skipStart: number = 0,
|
||||
skipEnd: number = 0,
|
||||
) {
|
||||
await new Promise((res) => setTimeout(res));
|
||||
let i = 0;
|
||||
while (!document.body.contains(elm)) {
|
||||
for (let i = 0; i < 4; i++) {
|
||||
await new Promise<void>((res) => queueMicrotask(res));
|
||||
}
|
||||
i++;
|
||||
if (i === 100) break;
|
||||
}
|
||||
lang = lang.trim();
|
||||
let content = elm.textContent;
|
||||
if (skipStart) {
|
||||
|
||||
Reference in New Issue
Block a user