Skip to content

Entities are being processed in CDATA sections #632

@mwardle

Description

@mwardle
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions