autolink.js icon indicating copy to clipboard operation
autolink.js copied to clipboard

improve regex for links to be more accurate

Open nallown opened this issue 7 years ago • 7 comments

This resolves #3 and also improves the regular expression to match a few more links.

nallown avatar Feb 24 '18 09:02 nallown

Codecov Report

Merging #7 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master       #7   +/-   ##
=======================================
  Coverage   97.33%   97.33%           
=======================================
  Files           1        1           
  Lines          75       75           
  Branches       24       24           
=======================================
  Hits           73       73           
  Misses          2        2
Impacted Files Coverage Δ
src/index.js 97.33% <ø> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 3400fe8...1ef4056. Read the comment docs.

codecov[bot] avatar Feb 24 '18 09:02 codecov[bot]

Maybe we can switch to https://github.com/kevva/url-regex since it's really hard to maintain regexp 😂

egoist avatar Feb 24 '18 09:02 egoist

Regex are hard to maintain but this one should be fine.

If you want a simple one that doesn't fail then we can match for www. and http(s):// for URLs and <word> @ <word> . <word> for emails. I've tested that one with my site for quite a while now and it hasn't failed.

nallown avatar Feb 24 '18 10:02 nallown

@egoist why haven't you accepted the pull request?

nallown avatar Mar 17 '18 10:03 nallown

@egoist If you don't want to use a regex, then you should still accept my pull request because without it, the people and I are still going to have that problem in #3 so you need to accept my pull request. Without it my users are still going to have that problem.

nallown avatar Mar 28 '18 23:03 nallown

You can decline and close this pull request if you want I already switched to a local copy of this module that has the problem solved.

nallown avatar Apr 10 '18 15:04 nallown

@egoist could this be merged in the meantime ? I'm actually having the same problem as in #3

kbonnin avatar Jun 27 '18 11:06 kbonnin