[Web], [Mobile], [Desktop] - Unable to insert link mailto or tel
tsafundzic opened this issue · comments
Tomislav Safundzic commented
Is there an existing issue for this?
- I have searched the existing issues
- This issue was mentioned before, but nothing has been done: #1048
Flutter Quill version
9.3.11
Steps to reproduce
- Open flutter editor
- Select insert link from the quill editor
- Dialog with two input fields is shown (text and link inputs)
- It only works for http scheme and you can save it only in that case, if you enter link like mailto:something@gmail.com it doesn't allow you to save it. Same goes with tel scheme
Expected results
When you enter mailto:something@gmail.com or tel:123456789 in second input field in "link dialog" you should be able to save it
Actual results
It only works for http scheme and you can save it only in that case, if you enter link like mailto:something@gmail.com it doesn't allow you to save it. Same goes with tel scheme
Code sample
Just run the example project
Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
[Paste your logs here]
Tomislav Safundzic commented
Inside QuillToolbar, inside configurations there is buttonOptions which has linkRegExp and there you can add regex:
QuillToolbar.simple(
configurations: QuillSimpleToolbarConfigurations(
controller: _quillController,
buttonOptions: QuillSimpleToolbarButtonOptions(
linkStyle: QuillToolbarLinkStyleButtonOptions(
linkRegExp: RegExp(
r"(mailto:[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$)|(?:http|https)://\S+|(?:tel:)+[0-9]+$",
caseSensitive: false,
),
),
),
),
),