converter icon indicating copy to clipboard operation
converter copied to clipboard

No escaping of XML characters in PList output

Open spiralx opened this issue 10 years ago • 2 comments

When converting a JSON file to a PList, the string values in JSON aren't being escaped when they are converted to string tags in the PList. E.g. if I convert one of my package.json files with this line

"author": "James Skinner <[email protected]> (https://github.com/spiralx)",

then in the output PList it becomes

<string>James Skinner <[email protected]> (https://github.com/spiralx)</string>

which contains < and > instead of their XML entities, and makes the whole PList an invalid document. At the very least it should escape <, > and &.

Oddly enough when I convert the same package.json to XML, the output is escaped fine:

<author>James Skinner &lt;[email protected]&gt; (https://github.com/spiralx)</author>

spiralx avatar Mar 31 '14 23:03 spiralx

I've submitted a pull request to the plist module with a fix, but it looks pretty quiet there to me...

https://github.com/TooTallNate/node-plist/pull/44

I'm going to try and find another suitable PList parser/builder package that can be dropped in now, there's a few around.

spiralx avatar Apr 01 '14 03:04 spiralx

:+1: nice!

jonschlinkert avatar Apr 01 '14 04:04 jonschlinkert