Skip to content
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

Correctly sanitize object replacement character by treating as whitespace #495

Closed
alexvcasillas opened this issue Nov 29, 2024 · 3 comments · Fixed by #497
Closed

Correctly sanitize object replacement character by treating as whitespace #495

alexvcasillas opened this issue Nov 29, 2024 · 3 comments · Fixed by #497
Assignees
Labels

Comments

@alexvcasillas
Copy link

alexvcasillas commented Nov 29, 2024

Hey there, I'm Alex from Tiptap 👋🏻

I wanted to upstream this issue to you as it's something that's affecting linkifyjs directly. It seems that linkifyjs does not handle properly the sanitization of a string when it comes to the find method that looks for link matches within a string. Here's an example of this character: \uFFFC this is an object replacement character and it looks like an empty string to the naked eye but if you pass something like find('https://google.com this) (where the space between the .com and this is the given character \uFFFC) the method will return you that the link is https://google.com this which some might say it's correct as it's a valid unicode character but people will be very confused by this as we've been by the reports we were having in our editor repo.

Just wanted to upstream this to you to see if it's something that you'd consider adding to the find method or to help anyone that might be having this issue so they know what could be about.

This was the issue in which we ended up discovering this ueberdosis/tiptap#5679 just in case you're curious what this could potentially cause :)

Hope you have a great day 🙇🏻

@nfrasser
Copy link
Owner

Hi Alex, thanks for reporting! This should be a doable fix, linkify can interpret \uFFFC as whitespace and therefore exclude anything that comes after it from the link. Will update here when the fix is available.

@nfrasser nfrasser self-assigned this Nov 29, 2024
@nfrasser nfrasser added the bug label Nov 29, 2024
@alexvcasillas
Copy link
Author

Thank you @nfrasser 🙇🏻

nfrasser added a commit that referenced this issue Dec 4, 2024
@nfrasser nfrasser changed the title Object Replacement Characters not being sanitized Correctly sanitize object replacement character by treating as whitespace Dec 4, 2024
@nfrasser
Copy link
Owner

nfrasser commented Dec 4, 2024

@alexvcasillas fix is available in the latest v4.2.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants