dtjohnson / xlsx-populate

Excel XLSX parser/generator written in JavaScript with Node.js and browser support, jQuery/d3-style method chaining, encryption, and a focus on keeping existing workbook features and styles in tact.
MIT License
956 stars 183 forks source link

Sanitize XML #290

Open jwickens opened 4 years ago

jwickens commented 4 years ago

XML only allows a subset of the characters supported by javascript: https://www.w3.org/TR/2008/REC-xml-20081126/#charsets

There are many use cases for reading characters from other formats and then putting them into an excel spreadsheet. For example, see this stack overflow: https://stackoverflow.com/questions/35634907/invalid-xml-character-xslt-error-while-processing-xml

This PR adds a new function to sanitize strings passed in via Cell.value() or via RichText. It also adds unit tests for this sanitization.

rickharrison commented 4 years ago

@dtjohnson If you would like any help managing this repo, @jwickens and I would be more than happy to help out.

lukewlms commented 3 years ago

@rickharrison @jwickens Any interest in forking this? Looks like no action from @dtjohnson since March 2 though would be great if maintenance were to resume. (We're trying this repo out on a production project for the first time.)

jwickens commented 3 years ago

Personally, I would err on the side of patience and seeing if @dtjohnson has time and energy later. Open source can be a thankless yet highly demanding task. Do share though if you start pulling various fixes together. We've been using this repo in production for quite some time and have had no issues apart from this very minor issue.