-
Notifications
You must be signed in to change notification settings - Fork 9
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
Custom punct before blocks #11
Comments
Thanks to @LLBlumire wildcards are now allowed in close tags, so it is now easier to use "blocks" in element name. Currently wildcard is limited to already valid NodeName, so: //this works:
<{"foo"}> </_>
//this doesn't:
<@{"foo"}> </ @> Because there still might be needs for special puncts in element name place, i decide to keep this issue open for a while. Probably one way to add custom punctuation support is to allow |
I would be interested in working something probably related, I need a custom syntax in the tag, in my case, I want to support This could probably be similar to custom blocks, though the parser supplied here has more responsibility, as it needs to terminate at the closing If you have an idea how you want this to be implemented, I'd be happy to contribute. |
Maybe we could replace the Alternatively, we could make (Perhaps we could even parse the remaining tokens in the tag as |
@ModProg hi, in my opinion it could be done by extending
So that adding new type of elements would be moved outside of rstml. There is two challenges that need to be solved:
|
I guess a reasonable default would be Another question, would this custom node necessarily be open tag, body, and optional closing tag, or should it be able to parse any syntax, i.e. even one not starting with Technically this is something that is already supported by reparsing if we were to support the peeking to be called even without a leading |
If we go with the fully custom node, I think it would make sense to expose part of |
Yew support "Dynamic tag" https://yew.rs/docs/concepts/html/elements#dynamic-tag-names
Which allows writing
Current implementation of
syn-rsx
, instead force you to write same code in following syntaxTo support yew syntax, we should extend transform_fn for blocks to also support outer punctuation.
Can be related to #8
To avoid duplication in current syntax (in open and closed tags), we can also avoid matching them if node_name has
Block
type, this allowing to support syntax like:The text was updated successfully, but these errors were encountered: