We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
unpairedTags option doesn't work if not followed immediately by a paired tag, its parent consumes the next sibling.
<root> <a> <unpaired> </a> <b>whatever</b> </root>
As per the API example:
const xmlDataStr = ` <root> <a> <unpaired> </a> <b>whatever</b> </root> `; const options = { unpairedTags: ["unpaired"] }; const parser = new XMLParser(options); const output = parser.parse(xmlDataStr);
{ "root": { "a": { "unpaired": "", "b": "whatever" } } }
Correct structure can be generated by changing input to:
<root> <a> <unpaired><pair>foo</pair> </a> <b>whatever</b> </root>
which triggers correct parsing, eg:
{ "root": { "a": { "unpaired": "", "pair": "foo" }, "b": "whatever" } }
{ "root": { "a": { "unpaired": "", }, "b": "whatever" } }
Would you like to work on this issue?
The text was updated successfully, but these errors were encountered:
I'm glad you find this repository helpful. I'll try to address your issue ASAP. You can watch the repo for new changes or star it.
Sorry, something went wrong.
This issue is fixed in v4.2.2, Please visit solothought to read about latest features released.
No branches or pull requests
Description
unpairedTags option doesn't work if not followed immediately by a paired tag, its parent consumes the next sibling.
Input
Code
As per the API example:
Output
Correct structure can be generated by changing input to:
which triggers correct parsing, eg:
expected data
Would you like to work on this issue?
The text was updated successfully, but these errors were encountered: