-
Notifications
You must be signed in to change notification settings - Fork 18
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
Added exception handling to color parsing #12
Conversation
It might be a good idea to comment on why the code returns |
We could do better by creating exceptions controlled by the developer himself. That is, adding functions so that in any case in which an exception is thrown, the developer is the one who decides what to do with the object that is going to be given to him (whether he will do a rethrow, or show his own custom exception, or just show a message) |
In my case, someone was trying to paste a blob of html into flutter_quill editor and one color style was causing the exception so nothing was pasted. Not sure a calling application would have any idea how to handle the exception, at a minimum the text should paste, which is what happens with the current try / catch. |
Maybe we could paste as plain text when in case of a failure. I'm thinking about adding paste as a plain text option in the context menu or disabling the rich text paste by default completely in v11 as default. In either case, in v11, it's possible to override the default without rewriting it completely. |
Maybe we could paste as plain text when in case of a failure. I'm thinking about adding paste as a plain text feature or disabling the rich text paste by default completely. I welcome suggestions. In either case, in v11, it's possible to override the default without rewriting it completely. |
I do like the the html paste but need control over what attributes are allowed as our editor implementation doesn't allow all of the editor features. Having a plain text feature or a callback to edit pasted delta would be better than what I'm doing now. `
|
Can file an issue with the details on Flutter Quill repo? So we don't lose track of it, with your suggestion, and what do you think would be better with an example. I plan on looking at this issue soon. |
Added exception handling when parsing a color value. Saw the following css color value on a website...
color: rgb(0 0 0/var(--tw-text-opacity));
Looks like something from Tailwind CSS. In any case, released code throws an exception and clipboard paste is halted.