-
-
Notifications
You must be signed in to change notification settings - Fork 344
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
Windows: Link decays into multiple links when pasting #1496
Comments
Is this an issue of ProseMirror incorrectly parsing the HTML from the clipboard, or the HTML not making sense in the first place? In the latter case, it may not be something the library can do much about. |
Without ProseMirror, I created a textarea and registered an event handler for ClipboardEvent. The HTML seems to be valid: onPaste(ev: ClipboardEvent): void {
console.log("Pasting", ev.clipboardData?.getData("text/html"))
} Results in:
|
Do you maybe have a custom paste handler in your editor? One that tries to detect and autolink urls? When I try to paste the HTML you show, I just get a regular, single link, as expected. |
We use ProseMirror via https://sibiraj-s.github.io/ngx-editor/. And indeed, it has a plugin that linkifies pasted text: I will investigate whether this is the cause. |
It seems that the HTML is first pasted, and then the @sibiraj-s is this intended behavior? |
Since the misbehavior doesn't seem to be in code I maintain, I'm going to close this issue here. |
Hi @REPLicated, I have to check, please create a issue in the editors repo and continue the discussion there. |
In Edge on Windows, certain pasted links "decay" into two separate links, where one of them is invalid.
Windows is special because when copying the URL of an open tab, the clipboard content is structured (presumably HTML), where the link text is the title of the tab and the href the actual URL.
Example: When copying the link from a tab with title
foo:bar.pdf
and URLhttp://localhost/foobar
, this results in the editor HTMLThe text was updated successfully, but these errors were encountered: