diff --git a/lib/render/html.js b/lib/render/html.js index a03a4062..b53fddd8 100644 --- a/lib/render/html.js +++ b/lib/render/html.js @@ -8,7 +8,7 @@ var reHtmlTag = /\<[^>]*\>/; var reUnsafeProtocol = /^javascript:|vbscript:|file:|data:/i; var reSafeDataProtocol = /^data:image\/(?:png|gif|jpeg|webp)/i; -var potentiallyUnsafe = function(url) { +function potentiallyUnsafe(url) { return reUnsafeProtocol.test(url) && !reSafeDataProtocol.test(url); }; @@ -65,7 +65,7 @@ function linebreak() { function link(node, entering) { var attrs = this.attrs(node); if (entering) { - if (!(this.options.safe && potentiallyUnsafe(node.destination))) { + if (!(this.options.safe && this.potentiallyUnsafe(node.destination))) { attrs.push(['href', esc(node.destination, true)]); } if (node.title) { @@ -81,7 +81,7 @@ function image(node, entering) { if (entering) { if (this.disableTags === 0) { if (this.options.safe && - potentiallyUnsafe(node.destination)) { + this.potentiallyUnsafe(node.destination)) { this.lit('