10000 Custom nodes with unquoted text integration · Issue #39 · rs-tml/rstml · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Custom nodes with unquoted text integration #39

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

Closed
vldm opened this issue Oct 11, 2023 · 1 comment
Closed

Custom nodes with unquoted text integration #39

vldm opened this issue Oct 11, 2023 · 1 comment

Comments

@vldm
Copy link
Collaborator
vldm commented Oct 11, 2023

Currently RawText parser is eating all tokens except one from whitelist (https://github.com/rs-tml/rstml/blob/main/src/node/raw_text.rs#L121):

  • < - tag start
  • " - quoted text
  • { - rust expression started

This is done to prevent eating something that can be treated as Node variant.

But introducing custom nodes in #34 allows library users to extend Node variant.
For example, one can try to add support of control-flow through "escaping sequence":

<div>
@ if x % 2 = 0 {
even
} else {
odd
}
</div>

Currently example above should work fine, but if we will try to mix it with RawText it will fail

Example that will not work:

<div>
x is 
@ if x % 2 = 0 {
even
} else {
odd
}
</div>
@vldm
Copy link
Collaborator Author
vldm commented Jan 14, 2024

Closed in #44

@vldm vldm closed this as completed Jan 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0