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

"HTML" name for ViewComponents and TagHelpers not generated correctly if class name contains extended letters #10844

Open
ElJacoTaco opened this issue Sep 5, 2024 · 2 comments
Labels
area-compiler Umbrella for all compiler issues untriaged

Comments

@ElJacoTaco
Copy link

Class names in C# allow extended letters like ÅÄÖ. When using pascal casing and a new word begins with an extended letter like TestÄa the generated markup is wrong.

Steps to reproduce:

  1. Create a ViewComponent with the class name TestÄh.
  2. Generated markup to use it should be <vc:test-äa>
  3. Generated markup is <vc:testäa>

The actual issue is with the regex here:

"(?<!^)((?<=[a-zA-Z0-9])[A-Z][a-z])|((?<=[a-z])[A-Z])",

Solution:
Change the regex so it supports extended letters just like class names do.

@jjonescz
Copy link
Member

Thanks for reporting this issue. However, fixing this would break users that rely on the current behavior (and they wouldn't notice the break until runtime). Given that and the narrow impact of the bug, we likely won't fix it.

@jjonescz jjonescz closed this as not planned Won't fix, can't repro, duplicate, stale Sep 12, 2024
@jjonescz
Copy link
Member

A non-breaking alternative would be to generate both tag helpers (<vc:test-äa> and <vc:testäa>). See this conversion: #10866 (comment). I'm reopening so this alternative gets triaged.

@jjonescz jjonescz reopened this Sep 16, 2024
@jjonescz jjonescz removed their assignment Sep 16, 2024
@jjonescz jjonescz removed this from the 17.12 Planning milestone Sep 16, 2024
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 untriaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants