-
Notifications
You must be signed in to change notification settings - Fork 27
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
Pasted text often strangely bold #32
Comments
Hi @davidreedernst It would be nice if you could paste the content which results on unwanted bold text. If my assumption turns out to be correct, a possible solution could be to make the substitution of heading tags optional. |
That seemed like a very good guess. To test it, though, I just hacked the quill-paste-smart code to remove those I had the same thought: I wish I knew what exactly was getting pasted into quill after I select text in Google docs. Sadly, I don't know a way to do that. If you want to recommend something, I'm happy to hack at it for a while. It seems like there should be a way to use a DOMPurify hook to accomplish that. Rather than guide me through the process of figuring that out, though, it's probably easier if you just figure that out yourself. I get the error if I simply create a new Google doc, type in some random text, and paste that into my Quill. Does that happen for you too? |
btw. if yopu would like to play around .. here is the sandbox: |
The sandbox is a really nice setup, thank you for sharing that. My client is still interested in improving on what we have, so I may have time to devote to this at some point. However, it's unlikely to be in the next few days because of other priorities. I'll write back if I make any progress, in the meantime, I didn't want you to feel like I'd ghosted you. :) |
no worries. it's all right. i don't have much time for this side quest myself. |
First, thank you so much for this plugin! We've been using Quill for years, but just discovered some of the bugs related to pasting. We're very happy to have this tool!
The only weakness we're seeing is that text that's pasted in is sometimes bold, for no apparent reason. The easiest way to reproduce this is to
the resulting text will be bold, even though the text in the Google Doc was not.
We do not see this problem with all text. Text from the average website can be copied+pasted without this issue. I even tried with LibreOffice Writer instead of Google Docs, and it didn't happen there either. However, we did test a few other websites that didn't exhibit the same problem. So, I'm not sure what triggers it.
As a workaround, I've removed
<b>
and<strong>
fromallowed.tags
. This prevents the unwanted bolding, but of course, it also prevents wanted bolding, like when you actually use the Bold feature in Google Docs. We see this as preferable for our users, so that's what we have running right now. But if you have any ideas on how we could keep bold only when it makes sense, I'd love to hear about it. I dipped my toe into the DOMPurify hooks, but it didn't seem promising. I could be wrong about that, though.Thanks again for sharing this tool with the world!
The text was updated successfully, but these errors were encountered: