Skip to content

Commit 8941e66

Browse files
jeremymanningclaude
andcommitted
Fix wrapOrphanedTextNodes breaking checklist conversion
Skip the checklist section in wrapOrphanedTextNodes() to allow convertChecklistToInteractive() to properly iterate through individual nodes and find checkbox elements. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent ebcabc2 commit 8941e66

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

checklist.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,16 @@ document.addEventListener('DOMContentLoaded', function() {
1313

1414
// Wrap orphaned text nodes after h2 headings in containers
1515
// tex4ht sometimes generates text directly after h2 without wrapping in <p>
16+
// IMPORTANT: Skip the checklist section - it needs special handling
1617
function wrapOrphanedTextNodes() {
1718
var h2s = document.querySelectorAll('h2');
1819
h2s.forEach(function(h2) {
20+
// Skip the checklist section - it will be handled by convertChecklistToInteractive
21+
if (h2.textContent.toLowerCase().includes('checklist') &&
22+
h2.textContent.toLowerCase().includes('signature')) {
23+
return;
24+
}
25+
1926
var sibling = h2.nextSibling;
2027
var nodesToWrap = [];
2128

0 commit comments

Comments
 (0)