gitbrent / PptxGenJS

Create PowerPoint presentations with a powerful, concise JavaScript API.
https://gitbrent.github.io/PptxGenJS/
MIT License
2.94k stars 639 forks source link

Moving the empty text fix as some were getting through before #1311

Open lawtontom opened 10 months ago

lawtontom commented 10 months ago

Firstly thanks for an awesome package!

We were getting intermittent errors when converting a series of Tables into powerpoint slides. After some investigation it was down to the way the table's content was being split across slides. There was already an effort to fill empty cells in the source code, however under certain circumstances it appears empty text entries were still in the currTableRow.

To ensure any empty entries were filled I've removed the earlier check that appeared to allow some to remain and instead loop through and fill any empty entries before finally committing the row. I've tested this within our code base and the issue is fixed. We'll continue to use the fix but want to contribute it back.

I believe this will also help with issues like: https://github.com/gitbrent/PptxGenJS/issues/1168 and https://github.com/gitbrent/PptxGenJS/issues/1048

Happy to provide any further information as needed.

Thanks