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

Adjust XML Escaping to allow for incomplete xmlns inside a comment #462

Merged
merged 5 commits into from
Apr 12, 2024

Conversation

mrlacey
Copy link
Contributor

@mrlacey mrlacey commented Jan 14, 2024

Description:

Fixes #426 (issue)

As per the issue, an incomplete xmlns definition in a comment could break the XML parsing as it would result in an invalid XML document being produced as a result of the escaping.

This change modifies the XML escaping code to allow for such comments to not break the parsing process.

Additionally, this PR adds tests to verify that the XML escaping (& unescaping) code does not cause any issues. This part of the code previously had no test coverage. These tests use all the sample files currently included in the test project for other test cases. I, therefore, assume this to be a comprehensive collection of file scenarios. (A brief look at the files shows they cover a lot!)

Admittedly, the reported issue is a remote edge case, and so it's probably not a high-priority fix. However, as this PR increases test coverage hopefully makes it a beneficial update.

Checklist:

  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested my changes by running the extension in VS2017
  • I have tested my changes by running the extension in VS2019
  • I have tested my changes by running the extension in VS2022
  • If changes to the documentation are needed, I have noted this in the description above

Copy link
Contributor

@grochocki grochocki left a comment

Choose a reason for hiding this comment

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

Excellent, thank you! I appreciate the unit tests as well.

@grochocki grochocki merged commit c838c84 into Xavalon:master Apr 12, 2024
5 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.

Formatting fails if a comment contains 'xmlns:'
2 participants