-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Handling of @html in textarea tags #5603
Comments
Sometimes Svelte isn't quite normal html. The docs show how to bind_element_property to a |
Yes, it is true that I can use |
I don't know what I'd expect |
To achieve your desired outcome, you could use a div tag with the attribute |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Describe the bug
Svelte compiler fails to handle {@html} inside
<textarea>
tagsLogs
No output in browser console. Compiler throws error
Unexpected character '@' (7:11)
To Reproduce
https://svelte.dev/repl/001f72ee82ac4115920eaf086d785584
Expected behavior
The compiler compiles the code successfully, the output
<textarea>
contains the child HTML elements in the string.Stacktraces
N/A
Information about your Svelte project:
Your browser and the version: Firefox 82, Chrome 86 (doesn't matter)
Your operating system: Windows 10 (doesn't matter)
Svelte version: 3.29.4
Whether your project uses Webpack or Rollup: None, as I used Snowpack in dev mode.
Severity
Low. I was able to use
<div>
instead for my use case.Additional context
I was trying to integrate TinyMCE editor into my Svelte app. On the surface, TinyMCE uses <textarea> and the content to be edited must be children of that
<textarea>
. But upon reading through their docs (it's a bit unclear) turns out<div>
can be used too, so that's my solution for the time being.The text was updated successfully, but these errors were encountered: