v11.0.6 - Preserve w:rPr on inline-drawing runs (fixes Word cell clipping)
Fixed
Inline-drawing runs lost their w:rPr on round-trip, causing images to clip into adjacent table cells in Word.
When a run contained <w:r><w:rPr>...</w:rPr><w:drawing/></w:r>, the parent run's properties (w:rFonts, w:noProof, w:b, w:color, etc.) were silently dropped during parse and never re-emitted by ImageRun.toXML(). Word then computed line metrics for the drawing's line using the default font instead of the explicit w:rFonts from the source, shifting the baseline. Images with a drop-shadow wp:effectExtent overflowed their containing row and rendered as clipping into the previous cell.
ImageRun now serializes w:rPr via the standard Run.generateRunPropertiesXML path, and DocumentParser applies the parent run's properties at all three drawing parse sites (matching what w:pict / w:object runs have always done).
Affects: any loaded document with images in tables, particularly visible when images carry a drop shadow or border with non-zero effectExtent. Programmatic image creation via createImageRun() was not affected.
Tests
New regression coverage in tests/core/ImageRunRPrRoundTrip.test.ts:
w:rFonts/w:noProof/w:colorsurvive on a body-level drawing run- The same survives inside a table cell
- A source run with no
w:rPrdoes not get a synthetic one fabricated on save
Full suite: 5576 tests pass.
Upgrade
Safe to upgrade from any 11.0.x release without code changes.
npm install docxmlater@11.0.6