fix: exclude tel: links from parsing #1318 (#1344)

Telephone links will no longer be incorrectly parsed as web links.

Signed-off-by: Scott Simontis <yo@scottsimontis.io>
This commit is contained in:
Scott Simontis 2019-12-31 14:41:05 -05:00 committed by Nicolas Giard
parent 3092615c5e
commit bb03aed1c8

View File

@ -39,8 +39,9 @@ module.exports = {
$('a').each((i, elm) => {
let href = $(elm).attr('href')
// -> Ignore empty / anchor links
if (!href || href.length < 1 || href.indexOf('#') === 0 || href.indexOf('mailto:') === 0) {
// -> Ignore empty / anchor links, e-mail addresses, and telephone numbers
if (!href || href.length < 1 || href.indexOf('#') === 0 ||
href.indexOf('mailto:') === 0 || href.indexOf('tel:') === 0) {
return
}