Added typesafety for multiple tags #80
JaapWijnen
started this conversation in
Ideas
Replies: 1 comment
-
I'm going to convert this to a discussion. I think we're always open to more safety. Just have to be mindful of things that affect compile times :) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey! Really like the library. I was playing around with it and saw that it was possible to do something like
And tags like
.div
and.script
can be used anywhere in .document..script
can also be used anywhere within.html
which are all examples of invalid html.I was playing around a bit and it would be quite easy to improve on this behavior by
ChildOf
for doctype.ChildOf
forscript
tags (and some others) and move these instead to specific extensions ofChildOf
(introducing a little bit more code)ChildOf where Element == Tag.Body
All these static functions would also return a ChildOf<Tag.Body> instead of the previousNode
type. Then we can use them nested as well!I've got this working locally and works quite nice! :) Let me know if you're interested in a PR for this behavior!
Beta Was this translation helpful? Give feedback.
All reactions