Xavalon / XamlStyler

Visual Studio extension to help format your XAML source code
Apache License 2.0
1.17k stars 128 forks source link

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

Closed mrlacey closed 4 months ago

mrlacey commented 7 months ago

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: