From 5087bb279341423d78de68628113a74a702ef185 Mon Sep 17 00:00:00 2001 From: segayuu Date: Sat, 18 May 2019 11:42:00 +0900 Subject: [PATCH] Refactor(es2015): indexOf to startsWith --- lib/renderer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/renderer.js b/lib/renderer.js index 5a8974c..27d04ba 100644 --- a/lib/renderer.js +++ b/lib/renderer.js @@ -46,7 +46,7 @@ Renderer.prototype.link = function(href, title, text) { return ''; } - if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) { + if (prot.startsWith('javascript:') || prot.startsWith('vbscript:') || prot.startsWith('data:')) { return ''; } }