Description
While the parser supports both & and & for the character &, it does not support the unicode entity & for the same character, and it can't be manually added through the addEntity method on the parser due to & being disallowed from being added.
Input
Attempt to parse a piece of XML which contains the entity & in a field.
Code
const parser = new XMLParser({ ignoreDeclaration: true, ignoreAttributes: false, attributeNamePrefix: "_", numberParseOptions: { leadingZeros: false, hex: true } });
parser.parse(`<title>Crimson Desert dev has started R&D on a Nintendo Switch 2 version</title>`)
Output
{
"title": "Crimson Desert dev has started R&D on a Nintendo Switch 2 version"
}
expected data
{
"title": "Crimson Desert dev has started R&D on a Nintendo Switch 2 version"
}
Description
While the parser supports both
&and&for the character&, it does not support the unicode entity&for the same character, and it can't be manually added through theaddEntitymethod on the parser due to&being disallowed from being added.Input
Attempt to parse a piece of XML which contains the entity
&in a field.Code
Output
expected data