-
Notifications
You must be signed in to change notification settings - Fork 877
feat: allow to override link validation check, and accept mailto and other links by default #2525
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
base: master
Are you sure you want to change the base?
Conversation
…validation in the toolbar, allows to insert mailto and other links by default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I'll test it as soon as possible.
My bad jasj. |
I will change to draft and add the tests soon before merging this PR. |
@@ -4,6 +4,7 @@ import 'package:flutter/cupertino.dart'; | |||
import 'package:flutter/material.dart'; | |||
import 'package:meta/meta.dart' show experimental; | |||
|
|||
import '../../../internal.dart' show AutoFormatMultipleLinksRule; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This import should be updated to use the insert.dart
file directly.
Description
Allow the toolbar to insert links like
mailto
by default, allow to override the link validation with a callback rather than Regex to give users more control, improve doc comment ofcustomLinkPrefixes
and legacy code and confusing naming, adharing to common best practices.customLinkPrefixes
which is in the editor, is only used to check whether this link is valid, if it's invalid,https://
will be appended as prefix to the link (google.com
->https://google.com
).validateLink
inQuillToolbarLinkStyleButtonOptions
allows the validation check to be overridden to determine whether this link can be inserted.However,
AutoFormatMultipleLinksRule
still uses the old regex and doesn't supportmailto
and the others.To test this branch:
Related Issues
http://
orhttps://
#2492Type of Change