Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CDATA bug #132

Closed
elazutkin-dynata opened this issue Oct 1, 2019 · 3 comments
Closed

CDATA bug #132

elazutkin-dynata opened this issue Oct 1, 2019 · 3 comments

Comments

@elazutkin-dynata
Copy link

The repro case:

const parseXml = require('ltx/lib/parse');
const tree = parseXml('<a><b><![CDATA[]]></b><b><![CDATA[--><c>&d;]]></b></a>');
console.log('Done:', !!tree);

Produces:

.../node_modules/ltx/lib/escape.js:44
  throw new Error('Illegal XML entity ' + match)
  ^

Error: Illegal XML entity &d;
    at unescapeXMLReplace (.../node_modules/ltx/lib/escape.js:44:9)
    at unescapeXML (.../node_modules/ltx/lib/escape.js:59:7)
    at SaxLtx.write (.../node_modules/ltx/lib/parsers/ltx.js:94:33)
    at Parser.write (.../node_modules/ltx/lib/Parser.js:56:15)
    at parse (.../node_modules/ltx/lib/parse.js:23:5)
    at Object.<anonymous> (.../scripts/bug.js:2:14)
    at Module._compile (internal/modules/cjs/loader.js:945:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:962:10)
    at Module.load (internal/modules/cjs/loader.js:798:32)
    at Function.Module._load (internal/modules/cjs/loader.js:711:12)
sonnyp added a commit that referenced this issue Oct 2, 2019
sonnyp added a commit that referenced this issue Oct 2, 2019
@sonnyp
Copy link
Member

sonnyp commented Oct 2, 2019

fixed in v2.9.2

@sonnyp sonnyp closed this as completed Oct 2, 2019
@sonnyp
Copy link
Member

sonnyp commented Oct 2, 2019

thanks for the report!

@elazutkin-dynata
Copy link
Author

Thank you for fast-tracking it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants