senny / sablon

Ruby Document Template Processor based on docx templates and Mail Merge fields.
MIT License
446 stars 128 forks source link

Fix inline paragraph block level replace bug #131

Closed stadelmanma closed 5 years ago

stadelmanma commented 5 years ago

There was a bug in the old code that caused some selectors to fail when working inside an InlineParagraphBlock object since there wasn't an enclosing w:p tag. Additionally, for the ancestors selector to work I needed to enclose the paragraph tag in another layer for some odd reason. This affected images that had all their fields inside a single paragraph (see #109 and later half of #105 ).

Additionally, this also fixed a so far unreported bug when HTML or WordML insertion was used to inject body level content (i.e. paragraph tags) inside a block construct that was all contained by the same paragraph tag.

Fixes #109