-
Notifications
You must be signed in to change notification settings - Fork 93
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
SSE plugin trims whitespace #658
Comments
Please provide a demonstrable example so I can investigate this. |
Here is an example where the first html snippet is when loading the page, and the second snippet is when the fragment is sent over SSE. Any formatted text like JSON that uses tabs or spacing for format gets trimmed. Probably a On load fragment:
Over SSE Fragment:
Here is the response the browser receives, with the JSON still formatted correctly. The data-star code must be calling trim
|
Thanks! Fixed in #678. You can test using https://github.com/starfederation/datastar/blob/develop/bundles/datastar.js |
This is fine for 99% of use-cases, however in the event the user wants to send down formatted text in a pretag, this becomes an issue. Maybe I'm missing something that could prevent this.
https://github.com/starfederation/datastar/blob/develop/library/src/plugins/official/backend/actions/sse.ts#L135
The text was updated successfully, but these errors were encountered: