-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 parsing is too case sensitive #341
Comments
One additional complication mentioned here is how to handle components whose names would now be detected as void elements. The simplest solution would probably be to just disallow those as component names, but I don't know how acceptable that is. |
These issues can in fact be resolved by a single There is something tempting about the JSX/React way of doing this, where we tell regular elements and components apart by the case of the first character in the tag - and then you don't even have to tell the compiler which components this uses - it's just the elements that begin with a capital letter. |
I agree. That's kind of the convention that's being used everywhere, perhaps we should just enforce it. The alternative is to parse everything, then validate the HTML (i.e. disallow void elements with children etc) once we've analysed the JavaScript and therefore know what's a component and what isn't. But that's more work to accommodate practices that should probably be discouraged — the ecosystem is healthier if everyone agrees on things like naming conventions and casing. |
Are you thinking about going so far as to remove the |
We'd still need |
Well, automatically binding imports is what React et al do. But yeah, the unused imports linting errors are a fair point. It does seem to be a bit out of line to be writing, say, a custom ESLint plugin for this like React has, so that using a component counts as a reference to it. Leaving |
Closing this, I don't think there's a lot else that makes sense to do here. This is hopefully mostly taken care of by warnings indicating that components should begin with a capital letter. |
There are a number of case sensitivity issues with parsing HTML currently. What I've observed -
<script>
and<style>
elements only get their special processing when they are written in lowercaseIt feels like these could all be resolved with a couple of well-placed
.toLowerCase()
s.The text was updated successfully, but these errors were encountered: