-
Notifications
You must be signed in to change notification settings - Fork 2.6k
clipboard: fix up html entities being escaped #6396
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
json = JSON.parse( | ||
tldrawHtmlComment | ||
.replace(/>/g, '>') | ||
.replace(/</g, '<') | ||
.replace(/&/g, '&') | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have some issues here at the moment:
Looking at the code for actually copying this stuff, it seems like we're not actually explicitly html-encoding these things ourselves. Where does the encoding come from? If we're using a regex here instead of a more robust html escaping system, why were these three chosen? I would have expected to see the reverse of this encoding explicitly happening somewhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
had a discussion with Alex offline. annoyingly we need to go back to the original revision of this:
https://github.com/tldraw/tldraw/pull/6344/commits
we still need to base64 encode the regular non-assets json.
ugh, this means we need a version 3...
btw can we sdk + dotcom hotfix this when it's ready? |
followup fix for #6344
because we don't base64 encode anymore, a knock-on effect is that any characters within this html blob gets treated as such. we need to unescape these upon paste.
hat-tip to Phil for the report.
Change type
bugfix
improvement
feature
api
other
Release notes