Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate better HTML and map that HTML to the correct place in the Razor document #7564

Open
ryanbrandenburg opened this issue Jun 2, 2021 · 10 comments
Assignees
Labels
area-compiler Umbrella for all compiler issues investigate Priority:2
Milestone

Comments

@ryanbrandenburg
Copy link
Contributor

Describe the bug

To support work such as https://github.com/dotnet/aspnetcore/issues/32820 it is a requirement that the Generated html from Razor have "Mapping" behavior like we have with C#. Here's an example of why it's needed:

<html>
<!body>
</!body>
</html>

This code currently generates warnings because the analyzers think we don't have a "body" element. Emitting

<html>
<body>
</body>
</html>

won't work because then everything that checks html (like diagnostics) will be off-by-one on that line, and similarly adding a space instead of the ! breaks everything.

CC @NTaylorMullen who I talked about this with.

@ryanbrandenburg ryanbrandenburg added the area-compiler Umbrella for all compiler issues label Jun 2, 2021
@mkArtakMSFT
Copy link
Member

@ryanbrandenburg it's not clear why it's important as we've seen no customers using this style. For now, backlog-ing.

@ghost
Copy link

ghost commented Jun 3, 2021

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@ryanbrandenburg
Copy link
Contributor Author

Here's another example:

<style>
    @{
    }
</style>

The above will result in CSS031 around the @{} because they currently get replaced with ~, which isn't legal in a CSS context. I'm sure there will be other contexts with similar problems.

@NTaylorMullen
Copy link
Contributor

it's not clear why it's important as we've seen no customers using this style.

Hmm? The ! operator is a Razor operator that allows customers to opt-out of TagHelperification of elements. It's an escape hatch that customers have to use in a multitude of scenarios 😄

@ryanbrandenburg
Copy link
Contributor Author

@mkArtakMSFT what do you think about the priority on this given the above info?

@ghost
Copy link

ghost commented Jul 9, 2021

Thanks for contacting us.
We're moving this issue to the Next sprint planning milestone for future evaluation / consideration. Because it's not immediately obvious that this is a bug in our framework, we would like to keep this around to collect more feedback, which can later help us determine the impact of it. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@mkArtakMSFT
Copy link
Member

Discussed this with @danroth27: we'll queue this up for .NET 7.

@ghost
Copy link

ghost commented Jul 12, 2021

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@ghost
Copy link

ghost commented Nov 11, 2021

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@mkArtakMSFT mkArtakMSFT transferred this issue from dotnet/aspnetcore Apr 12, 2022
@chsienki chsienki transferred this issue from dotnet/razor-compiler Oct 28, 2022
@ghost ghost added the untriaged label Oct 29, 2022
@davidwengier
Copy link
Contributor

Fixing this would also be a better solution for the workaround implemented in #6597

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-compiler Umbrella for all compiler issues investigate Priority:2
Projects
None yet
Development

No branches or pull requests

7 participants