ElyMark: the probe requires each task box laid out and visible (R2.14)

This commit is contained in:
ZacharyZhang-NY committed 2026-10-09 09:19:15 -04:00
1 parent eee3b9e288
commit 4efe14bce7
3 files changed
+8 -2

No files matched your search

+4 -1
View File
@@ -63,7 +63,10 @@ const CHECK: &str = r#"
const line = range.getClientRects()[0];
const top = item.getBoundingClientRect().top + parseFloat(mark.marginTop);
const size = parseFloat(getComputedStyle(item).fontSize);
const drawn = mark.content !== 'none' && parseFloat(mark.borderTopWidth) > 0 && mark.borderTopStyle !== 'none';
const shown = mark.display !== 'none' && mark.visibility === 'visible' && parseFloat(mark.opacity) > 0;
// A laid-out box pushes the text 1.5em in.
const inset = (item.querySelector('p').getBoundingClientRect().left - item.getBoundingClientRect().left) / size;
const drawn = shown && mark.content !== 'none' && parseFloat(mark.borderTopWidth) > 0 && Math.abs(inset - 1.5) < 0.05;
return [parseFloat(mark.width) / size, parseFloat(mark.height) / size, top + parseFloat(mark.height) / 2 - (line.top + line.height / 2), drawn];
}),
cells: view.querySelectorAll('.milkdown td').length,