diff --git a/bin/html2pptx.js b/bin/html2pptx.js index 7d78f42..7a38b3a 100644 --- a/bin/html2pptx.js +++ b/bin/html2pptx.js @@ -158,7 +158,7 @@ async function main() { // DashiAI format: .ppt-deck > .ppt-slide var deck = document.querySelector('.ppt-deck'); if (deck) { - slides = deck.querySelectorAll('.ppt-slide'); + slides = deck.querySelectorAll(':scope > .ppt-slide'); } if (!slides || slides.length <= 1) { slides = document.querySelectorAll( @@ -170,7 +170,11 @@ async function main() { } slides = Array.from(slides).filter(function (s) { var r = s.getBoundingClientRect(); - return r.width > 0 && r.height > 0; + var style = window.getComputedStyle(s); + return r.width > 0 && r.height > 0 && + style.opacity !== '0' && + style.display !== 'none' && + style.visibility !== 'hidden'; }); // Tags whose full text content should be a single text box