Skip to content

Tag casing inconsistency leads to parsing issues #17

Open
wnayes opened this issue Jun 13, 2020 · 2 comments · May be fixed by #18
Open

Tag casing inconsistency leads to parsing issues #17

wnayes opened this issue Jun 13, 2020 · 2 comments · May be fixed by #18

Comments

@wnayes
Copy link

wnayes commented Jun 13, 2020

I've seen cases where programmers use inconsistent tag casing for open and close tags.

<asp:Button runat="server"></asp:button>

ASP.NET is able to cope with this, but AspxParser will end up with an imbalance in the syntax tree.

These can be a little hard to track down, but it is reasonable to work around this issue by fixing the problem cases in the markup.

@wnayes wnayes linked a pull request Oct 19, 2020 that will close this issue
@GeorgeAlexandria
Copy link
Contributor

"BuTTon" and "bUTToN" are equal by EqualsNoCase, but does ASP.NET handle such cases or just assume that the open and close tags can start with lower char? If ASP.NET compares more strong than EqualsNoCase, we should compare the same way, else PR LGFM.

@wnayes
Copy link
Author

wnayes commented Oct 19, 2020

I think this code in TemplateParser.cs is specifically where they do a case insensitive check for close tag names:

https://referencesource.microsoft.com/#System.Web/UI/TemplateParser.cs,2791

Similarly, for tag prefixes I think this is reference source that shows they do case insensitive checks for those as well:

https://referencesource.microsoft.com/#System.Web/UI/TagNameToTypeMapper.cs,342

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants