-
Notifications
You must be signed in to change notification settings - Fork 857
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
Add "Paste as plain text" feature #1946
Comments
It looks like to paste plain text one should disable the following code blocks from quill_controller.dart:
But adding "Paste as plain text" to the context menu is not that straightforward, since the menu is implemented using |
@ellet0 Do you have any suggestion? |
If the user paste using the paste button above the keyboard, it should alwats paste as text. This behavior is specific to Android and will apply to all apps. As for the paste as plain text, we could also add the option to always paste as plain text and disable rich text pasting feature. Notice that if you don't use As for paste as plain text, it's might not be common or known by users, I would suggest having this option only if rich text paste is available. |
Indeed, Android keyboards (though, probably no all) allow to paste as plain text, as it in fact stored in the clipboard. So, it's some kind of an option too: "Paste" button pastes rich text while the keyboard pastes the plain one. However, it doesn't help on other OS.
Not quite sure how to check if flutter_quill_extensions is used.
Totally agree. |
There are different ways, one of them is to check the type of
Starting from The rich text, gif, and image features are disabled by default. You will have to use the extensions package and call a function to override the default implementation. The example already utilized the extensions package and called the |
Thanks, I'm able to change clipboard plugins by adding/removing Nevertheless, if I copy some inline text from the editor (i.e., several words on the same line), the format is preserved (for example, bold words remain bold) after paste, even for the default clipboard plugin. In fact, it looks like clipboard is not used here since the copied text and it's format are stored in the editor itself, see By the way, "instance" is misspelled in the code, we should correct it in the same PR: |
That's usually because of the browser restrictions on using the clipboard on the Web. Take a look at Super Clipboard Accessing clipboard on Web
Previously the Editor requested permission by default, then later it was disabled by default.
Yes, this was a feature before
Luckily we haven't exported the |
It seems that The private |
Do I understand correctly that currently copy+paste is supposed have following features?
If so, it looks reasonable. |
If you copy anything from the editor and paste it somewhere else in the document of the editor, it should paste it as it was before since it it will retrive it from the
The styles should be already preserved without the extensions package.
You should be able to paste HTML and Markdown files. And HTML from other apps and websites. If you're testing on the web, then it doesn't work and doesn't require We haven't implemented this feature yet, though. See PR #2001 and Issue #1998 for details. |
Thanks, it's much clearer now. |
|
Sure, I mean that |
Seems like an android feature, will add it and provide a property that should be enabled and user can enable it on other platforms, by default will be for Android. |
Is there an existing issue for this?
Use case
It would be great to have "Paste as plain text" feature, as e.g. TextField on Android has.
Sometimes format is not needed, like when text is copied from browser.
Also, this should help avoid misunderstanding on when formatted or plain text is pasted, see #1772.
Proposal
Implement "Paste as plain text" feature and add it to the context menu for pasting. Maybe there should be an option on whether "Paste as plain text" should be included into that menu or not.
The text was updated successfully, but these errors were encountered: