Skip to content

Commit

Permalink
refactor: remove unused 'sanitize' option
Browse files Browse the repository at this point in the history
  • Loading branch information
weyusi committed Jul 8, 2019
1 parent b45d527 commit f0c3fc5
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions lib/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,6 @@ function anchorId(str, transformOption) {

// Support AutoLink option
Renderer.prototype.link = function(href, title, text) {
if (this.options.sanitize) {
let prot;

try {
prot = decodeURIComponent(unescape(href))
.replace(/[^\w:]/g, '')
.toLowerCase();
} catch (e) {
return '';
}

if (prot.startsWith('javascript:') || prot.startsWith('vbscript:') || prot.startsWith('data:')) {
return '';
}
}

if (!this.options.autolink && href === text && title == null) {
return href;
}
Expand Down

0 comments on commit f0c3fc5

Please sign in to comment.