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

Support single quotes in attribute for the declaration node #117

Merged
merged 1 commit into from
Nov 1, 2024

Conversation

marrasen
Copy link

I found a bug where parsing a declaration node that uses single quotes for its attributes would result in wrong values in the attribute list, causing the input:

<?xml version='1.0' encoding='utf-8'?>

To generate the following output:
<?xml version="&#39;1.0&#39;" encoding="&#39;utf-8&#39;"?>

I modified the AddAttr function to trim both double and single quotes from attribute values. Added a test to ensure XML attributes with single quotes are correctly parsed.

Modified the `AddAttr` function to trim both double and single quotes from attribute values. Added a test to ensure XML attributes with single quotes are correctly parsed.
@zhengchun zhengchun merged commit bb12302 into antchfx:master Nov 1, 2024
9 checks passed
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 this pull request may close these issues.

2 participants