Browse Source

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>
Scott Simontis 5 years ago
parent
commit
bb03aed1c8
1 changed files with 3 additions and 2 deletions
  1. 3 2
      server/modules/rendering/html-core/renderer.js

+ 3 - 2
server/modules/rendering/html-core/renderer.js

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