Closed mario-lemes closed 7 years ago
@ritz078 Changing return expression of toURL from (string.indexOf('//') === -1) ? ('//' + string) : string
to (string.indexOf('http') ===-1)?('http://'+string):string
works well for flickr, slideshare and instagram
and removal of https?:\/\/(?:[0-9A-Z-]+\.)?
from regex.youtube works well for youtube
@SnehaMidha You have misunderstood the issue. The issue is only for normal urls where https://x.com
is converted to URL but www.x.com
is not converted to a url as the regex here doesn't identify the later as a valid URL. This has nothing to with services like instagram, youtube etc.
@ritz078 In the urlRegex function, the beginning says : (\b(https?|ftp|file):\/\/[^,.\s]+[^\s]*[^,.\s]+)|(?:https?:\/\/). So is it essentially looking for a URL which goes like https://https:// or ftp://https:// ? If this is the case, could you give us an example?
@ishakalra Hopefully this helps https://regex101.com/r/FkMl7i/1
@ritz078 Please check this link https://regex101.com/r/FkMl7i/2 This accepts www.github.com and others as well.
@sohamidha seems great. You can create a PR.
guys please don't make it a race to open a PR. Its tough for me 😄 . Try to open PRs for other issues. I understand this was the easiest one but I can help you for other issues too.
Hello @ritz078,
Why is not possible to linkify a url without http(s) protocol and only in the format like 'www.example.com'?
Thank you!