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
Uh oh!
There was an error while loading. Please reload this page.
-
Hey! Really like the library. I was playing around with it and saw that it was possible to do something like
And tags like
.divand.scriptcan be used anywhere in .document..scriptcan also be used anywhere within.htmlwhich are all examples of invalid html.I was playing around a bit and it would be quite easy to improve on this behavior by
ChildOffor doctype.ChildOfforscripttags (and some others) and move these instead to specific extensions ofChildOf(introducing a little bit more code)ChildOf where Element == Tag.BodyAll these static functions would also return a ChildOf<Tag.Body> instead of the previousNodetype. 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