, à la Markdown task list).
- const checkbox = li.querySelector(':scope > input[type="checkbox"]');
+ // Détection checkbox au niveau item :
+ // - direct child (GitHub task list, export interne)
+ // - direct child (Notion : checkbox-on / checkbox-off)
+ const inputCb = li.querySelector(':scope > input[type="checkbox"]');
+ const divCb = li.querySelector(':scope > div.checkbox, :scope > div[class*="checkbox"]');
+ const checkbox = inputCb || divCb;
const isChecklistItem = isChecklist || !!checkbox;
let checked = false;
- if (checkbox) {
- checked = checkbox.checked || checkbox.hasAttribute('checked');
- checkbox.remove();
+ if (inputCb) {
+ checked = inputCb.checked || inputCb.hasAttribute('checked');
+ inputCb.remove();
+ } else if (divCb) {
+ checked = /checkbox-on/.test(divCb.getAttribute('class') || '');
+ divCb.remove();
}
// Si le
contient lui-même des sous-listes, on émet d'abord un