razor
razor copied to clipboard
Support closed void tags with content in code blocks
Fixes https://github.com/dotnet/razor/issues/8460. Fixes https://github.com/dotnet/razor/issues/7258.
Void tags (e.g., <col>
, <link>
) in code blocks could not have a content and a closing tag, so everything after them was considered to be code. But if the tag is actually a component, I think that behavior doesn't make sense (see the associated issues).
I don't think I have time to walk through these changes before I'm out for the rest of the week. @jjonescz, when I get back I could use a walkthrough of how we support this outside of code blocks in the parser today.
how we support this outside of code blocks in the parser today
This problem really only appears inside code blocks. The parser consumes code, then encounters <
, starts consuming markup, and after <input>
it doesn't know whether it should continue parsing code (if <input>
is void self-closed tag) or markup (if it's a component that will be closed later). Outside code blocks, it always parses markup by default except when explicitly told not to (by @
transition)