powerpoint icon indicating copy to clipboard operation
powerpoint copied to clipboard

PPTX files are corrupted when XML special characters are used

Open alemarmed opened this issue 6 years ago • 1 comments

Hi, we are using this gem in a project and noticed that some .pptx files were corrupted, then I found that is because text is not XML escaped. Quick and easy steps to reproduce it:

require 'powerpoint'
@deck = Powerpoint::Presentation.new
@deck.add_textual_slide 'A&B', ['test']
@deck.save('test.pptx')

Of course there's an easy workaround: escape text before adding it to the slides. But I think that it should be fixed or included in the README.md as a known issue.

alemarmed avatar May 08 '19 07:05 alemarmed

my two cents.

use REMXL from ruby to escape text basically, REXML::Text.new('your string', false, nil, false)

ps1312 avatar Oct 03 '19 18:10 ps1312