Skip to content

Commit

Permalink
Refactor(es2015): indexOf to startsWith
Browse files Browse the repository at this point in the history
  • Loading branch information
segayuu committed May 18, 2019
1 parent 2ec5f98 commit 5087bb2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 '';
}
}
Expand Down

0 comments on commit 5087bb2

Please sign in to comment.