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>
pull/1365/head
Scott Simontis 5 years ago committed by Nicolas Giard
parent 3092615c5e
commit bb03aed1c8

@ -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
}

Loading…
Cancel
Save