Reporter |
|
---|---|
Created | Feb 21, 2018 2:13:11 PM |
Updated | Apr 10, 2018 2:52:36 PM |
Resolved | Apr 10, 2018 2:52:35 PM |
Subsystem | ASP.NET - Razor |
Assignee | Slava Trenogin (derigel) |
Priority | Critical |
State | Fixed |
Type | Bug |
Fix version | 2018.1.1 |
Affected versions | 2017.3 |
Fixed In Version ReSharper | Undefined |
VsVersion | All Versions |
When using a picture
tag with optional source
tags, Rider complains about it not being able to find a closing brace at the end of the file:
<picture>
@if(true) {
<source srcset="mdn-logo-wide.png" media="(min-width: 600px)">
} else {
<source srcset="alt-mdn-logo-wide.png" media="(min-width: 600px)">
}
<img src="mdn-logo-narrow.png" alt="MDN">
</picture>
I guess that the empty tag without a />
is throwing the parser off here, Razor parses this case correctly.
Altering both source
tags to be a valid xml empty tag <source srcset="mdn-logo-wide.png" media="(min-width: 600px)"/>
works around the issue.
Since razor is parsing this correctly, and redering the right markup, rider should complain. I think there is a whitelist of allowed empty tags without ending in />
, <source
should be included, I think.
The error results in squiggly lines on the file and all of it's parents. In big projects this is annoying since you would then ignore errors in other files more easily...
See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/picture