This commit is contained in:
Matthew Scragg 2014-02-06 21:40:58 -06:00
parent 904d83ea3c
commit d0777e2b85
15 changed files with 164 additions and 1363 deletions

View file

@ -5,7 +5,7 @@ hljs.initHighlightingOnLoad();
MDR = {
doc: null,
callback: WMD.convert,
sanitize: null, // Override
sanitize: true, // Override
convert: function(md, sanitize){
if (this.sanitize !== null) {
sanitize = this.sanitize;
@ -14,7 +14,13 @@ MDR = {
var html = this.doc.html;
if (sanitize) {
// Causes some problems with inline styles
html = html_sanitize(html);
html = html_sanitize(html, function(url) {
if(/^https?:\/\//.test(url)) {
return url
}
}, function(id){
return id;
});
}
html = this.hook(html);
return html;