autolink.js
autolink.js copied to clipboard
improve regex for links to be more accurate
This resolves #3 and also improves the regular expression to match a few more links.
Codecov Report
Merging #7 into master will not change coverage. The diff coverage is
n/a.
@@ 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 dataPowered by Codecov. Last update 3400fe8...1ef4056. Read the comment docs.
Maybe we can switch to https://github.com/kevva/url-regex since it's really hard to maintain regexp 😂
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.
@egoist why haven't you accepted the pull request?
@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.
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.
@egoist could this be merged in the meantime ? I'm actually having the same problem as in #3