razor icon indicating copy to clipboard operation
razor copied to clipboard

Support closed void tags with content in code blocks

Open jjonescz opened this issue 1 year ago • 2 comments

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).

jjonescz avatar Mar 31 '23 14:03 jjonescz

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.

333fred avatar Apr 04 '23 20:04 333fred

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)

jjonescz avatar Apr 05 '23 06:04 jjonescz