Closed vsfeedback closed 2 years ago
Simple repro:
@foreach (var num in Enumerable.Range(1, 10))
{
<span class="skill_result btn">
<!--asdfasd-->
<span style="margin-left:0px">
<svg>
<rect width="1" height="1" />
</svg>
</span>
<!--adfasfd-->
</span>
}
Super interesting that this repro'd. Will bereally curious as to why we barf on HTML comments
Something about the razor syntax tree I guess.. In the presence of the comment, LocateOwner
returns a different result for the line the span is on.. very strange.
But the differences between the tree with and without the comment look perfectly reasonable.. so weird..
Click here to see the differences (I'm hiding a stupidly long URL from you)
will need to debug through LocateOwner I guess..
I think this is a compiler issue...
In the code snippet from my comment above, for the line <span style="margin-left:0px">
, for the MarkupTextLiteral
node that is the whitespace in front of the span, GetSpanContext()
returns a SpanEditHandler that accepts None
characters. If I remove the comment above it, then it accepts Any
.
@TanayParikh @pranavkm @javiercn I have no idea what a span context even is, does that sound remotely reasonable? Or am I misunderstanding something? I don't want to just create a compiler issue if I'm missing something.
.. and now that I know what to look for, I can see it in the tree diff linked above. I've highlighted the whitespace-before-span-element:
@davidwengier updated your comment to include @javiercn. If LocateOwner is failing here then that's concerning
This is (another instance of) dotnet/razor-tooling#7505
This issue has been moved from a ticket on Developer Community.
When using html comments in a razor view (haven't tested razor pages) like this
and then using visual studio formatter to format the code (ctrl+ k, ctrl + d), then indentation does not work correctly. Please refer to screenshots for more info
Original Comments
Feedback Bot on 14/02/2022, 07:22 PM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
Original Solutions
(no solutions)