flutter-quill
flutter-quill copied to clipboard
Linkify urls in text
Is there an existing issue for this?
- [X] I have searched the existing issues
The question
It seems that not all variants of urls are linkified in the text only the urls with a prefix like http or https. I see support for regex, but only for QuillToolbarImageButton and other kinds of buttons. What I want is that when I add one of the urls below that the editor automatically detects that it's an url.
Urls that are linkified http://google.com https://google.com https://www.google.com
Urls that aren't linkified www.google.com google.com
I can remember that this used to work, but at the moment it isn't.
In QuillToolbar > QuillToolbarImageButton
, you can update regex of the link for all cases that you know
Isn't this just the regex for adding an image with an url? I meant the urls in the text.
Sorry, my mistake.
You can update linkPrefixes at here.
// this is default
const linkPrefixes = [
'mailto:', // email
'tel:', // telephone
'sms:', // SMS
'callto:',
'wtai:',
'market:',
'geopoint:',
'ymsgr:',
'msnim:',
'gtalk:', // Google Talk
'skype:',
'sip:', // Lync
'whatsapp:',
'http'
];
Thanks for the response. This is really nice if you want a prefix, but in my use case I don't want the prefix. For example, www.google.com and google.com are links without an prefix, but are still a link.
You can fork
, update
and make a PR
Basically, before, the package supported regex determination, but no one really made a regex to support a text like google.com
. You know what? Because of typographical errors, a lot of text will be automatically marked as a link
I think this is fixed