Try to reduce false positives in split link detection. #650

This commit is contained in:
ccd0 2015-12-01 03:08:28 -08:00
parent 6995f98834
commit 6840c9895d

View File

@ -49,7 +49,12 @@ Linkify =
while (saved = snapshot.snapshotItem i++)
if saved.nodeName is 'BR'
if /^(https?:\/\/)?[a-z0-9\-\.]+$/i.test(word) and snapshot.snapshotItem(i)?.data?.match(/^(\.[a-z0-9\-]+)*\//i) # link deliberately split
if (
# link deliberately split
(part1 = word.match /(https?:\/\/)?([a-z\d-]+\.)*[a-z\d-]+$/i) and
(part2 = snapshot.snapshotItem(i)?.data?.match /^(\.[a-z\d-]+)*\//i) and
(part1[0] + part2[0]).search(Linkify.regString) is 0
)
continue
else
break