-
Notifications
You must be signed in to change notification settings - Fork 25
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
Config for blocks without curly braces #22
Comments
I can take a stab at implementing this if you point me in the general direction |
Just to be sure: Your goal is to have code looking like e.g.
and have the element content be parsed as rust block? |
Exactly. Could even allow an attribute to toggle that behavior |
Currently that's not possible. It might be possible to introduce an "element child hook", where you would be responsible to parse starting from the opening I'm curious, why isn't
an option in your use case? If it's purely cosmetics, I'd say it isn't worth it. |
I'll look into the hook either way, might even be possible to hook the whole raw element content. |
It is 99% cosmetic. And I have it working as is right now. I'd say it's is somewhat semantic too though. Because in the rest of the app, my lib will take the return of the block and render it, assign it to an attribute, etc. I don't care what's inside the block, I only care about it's return. Whereas the block inside script will be handled in a special manner. The difference in syntax would hint at that difference in behavior. |
…-attribute Feat: add number support in NodeName attribute
Let's say I want to have rust code directly inside
<script></script>
, like Svelte and Vue do for JS. Would this be possible with the current configuration options?I think this would be implementable if I just went through the
TokenStream
and added{
after every<script>
and}
before every</script>
. Time complexity would go down the gutter though (maybe I could implement this with a map? which is lazy, but still). Maybe a config option to accept blocks directly inside certain tags would be useful. Or a more general Visitor-like API that would allow the insertions of the{
/}
where needed.The text was updated successfully, but these errors were encountered: