Repository navigation
v9.5.2 - Fix inter-row and body-level bookmark preservation
What's Changed
Fixes document corruption caused by bookmark elements appearing between table rows or body-level paragraphs.
Bug Fixes
- Fix inter-row bookmark preservation - Per ECMA-376, elements like
w:bookmarkEndcan appear betweenw:trelements in tables. The Table class now preserves these elements during round-trip processing. - Fix body-level bookmark preservation - Bookmark start elements that appear between paragraphs (outside of tables) are now captured and attached to the following paragraph.
New API
Inter-Row Content Methods (Table class)
// Add content between rows
table.addInterRowContent(afterRowIndex, '<w:bookmarkEnd w:id="107"/>', 'bookmarkEnd');
// Get all inter-row content
const content = table.getInterRowContent();
// Get content after specific row
const afterRow2 = table.getInterRowContentAfterRow(2);
// Clear all inter-row content
table.clearInterRowContent();Technical Details
- Introduced
InterRowContentinterface for type-safe inter-row element storage - DocumentParser now extracts inter-row elements via
extractInterRowElements() - DocumentParser now captures body-level bookmarkStart via
extractBodyLevelBookmarkStarts() - Table.toXML() outputs inter-row content in correct positions using raw XML passthrough
Full Changelog: v9.5.1...v9.5.2