-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
fix: stronger enforcement of normalizeLink #6728
Conversation
We should only accept links that start with https?:// and if it doesn't then add it.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
@vjeux we were earlier allowing only |
I did not check the code change in details, but please make sure you continue to allow markdown and [[wiki]] links. |
we'll need to add a As for |
but the issue is how to propagate |
Ok, so instead I've used a sanitizer from Braintree (https://github.com/braintree/sanitize-url), which is permissive enough to allow custom formats such as markdown (@zsviczian you'll need to sanitize the url yourself once you parse it and render, unless you're using a markdown renderer that does it for you). If needed, we export our link normalize from the package as This way we don't have to support That said, Further, we still want to support relative links & retain opening relative links in the same tab. |
Thanks @vjeux! |
Co-authored-by: dwelle <[email protected]>
Co-authored-by: dwelle <[email protected]>
We should only accept links that start with
https?://
and if it doesn't then add it. Do not allow for relative links.Test Plan:
On excalidraw.com create a rectangle with a link
javascript://%0aalert(document.domain)
and save it: javas.excalidraw.zipIn this PR, load the file above and see that the link has
https://
added before:In this PR, create a rectangle with the above link. Make sure that
https://
is added before.