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

fix(internal): encode XML tokens without escaping #1216

Merged
merged 4 commits into from
Sep 2, 2024
Merged

Conversation

cuixq
Copy link
Contributor

@cuixq cuixq commented Aug 30, 2024

#1184

Currently, texts are escaped in xml.EncodeToken() and this generates unexpected diff when writing updates to XML.

This PR adds func encodeToken() that writes CharData directly to avoid escaping, and all buffered XML is flushed after encoding.

This PR also fixes #1215 by adding two more space to indentation.

@codecov-commenter
Copy link

codecov-commenter commented Aug 30, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 12 lines in your changes missing coverage. Please review.

Project coverage is 66.00%. Comparing base (7fdf3fc) to head (f63802d).

Files with missing lines Patch % Lines
internal/resolution/manifest/maven.go 50.00% 3 Missing and 9 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1216      +/-   ##
==========================================
+ Coverage   65.96%   66.00%   +0.04%     
==========================================
  Files         168      168              
  Lines       14152    14145       -7     
==========================================
+ Hits         9335     9337       +2     
+ Misses       4299     4293       -6     
+ Partials      518      515       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cuixq cuixq marked this pull request as ready for review August 30, 2024 04:37
Copy link
Member

@michaelkedar michaelkedar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

internal/resolution/manifest/maven.go Outdated Show resolved Hide resolved
@cuixq cuixq merged commit 2b3e0fd into google:main Sep 2, 2024
13 checks passed
@cuixq cuixq deleted the xml branch September 2, 2024 01:14
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.

Indentation when writing new dependencies to Maven pom.xml
3 participants