-
-
Notifications
You must be signed in to change notification settings - Fork 306
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
Parser erroneously adds "@_/": true
attr for self-closing stop nodes
#654
Labels
Comments
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. |
smoores-dev
added a commit
to smoores-dev/storyteller
that referenced
this issue
May 13, 2024
Work around a bug in fast-xml-parser: NaturalIntelligence/fast-xml-parser#654 Also use the `parseNodeValue` flag to disable parsing node values to numbers and booleans, removing the need for other workarounds. Changelog: fixed
Thanks to highlight it. We would have to put a condition in the code to avoid an attribute having the name "/" or "/>" or ">" or any other possibility. This check can be placed in a buildAttributesMap function and attribute function for v5. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
When the
allowBooleanAttributes
flag is set onXMLParser
, the parser will interpret the closing/
in a self-closing stop node as a boolean attribute. This introduces further problems when attempting to build the parsed data back into a string, as it produces invalid XML. E.g.,<script src="script.js" />
becomes<script src="script.js" //>
(note the double slash).It is possible to implement a workaround by adding an
updateTag
method that removes@_/
attributes.Input
Code
Output
expected data
Would you like to work on this issue?
Bookmark this repository for further updates. Visit SoloThought to know about recent features.
The text was updated successfully, but these errors were encountered: