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

Entities are being processed in CDATA sections #632

Closed
5 of 6 tasks
mwardle opened this issue Jan 9, 2024 · 1 comment · Fixed by #633
Closed
5 of 6 tasks

Entities are being processed in CDATA sections #632

mwardle opened this issue Jan 9, 2024 · 1 comment · Fixed by #633

Comments

@mwardle
Copy link

mwardle commented Jan 9, 2024

  • Are you running the latest version?
  • Have you included sample input, output, error, and expected output?
  • Have you checked if you are using correct configuration?
  • Did you try online tool?

Description

Entities are being processed in CDATA sections which appears to be incorrect. A previous issue (#40) provides discussion related to this issue. It appears that this issue was fixed in Version 3 and reintroduced in Version 4. To avoid a breaking change, adding an option to prevent entities from being processed within CDATA sections could be appropriate.

Input

Code

const options = {
  ignoreDeclaration: true,
  processEntities: true,
}
new (XMLParser(options)).parse(`<Root><a>test&gt;</a><b><![CDATA[test&gt;]]></b></Root>`)

Output

{ Root: { a: 'test>', b: 'test>' } }

expected data

{ Root: { a: 'test>', b: 'test&gt;' } }

Would you like to work on this issue?

  • Yes
  • No

Bookmark this repository for further updates. Visit SoloThought to know about recent features.

Copy link

github-actions bot commented Jan 9, 2024

We're glad you find this project helpful. We'll try to address this issue ASAP. You can vist https://solothought.com to know recent features. Don't forget to star this repo.

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

Successfully merging a pull request may close this issue.

1 participant