fixes #18 relative link bug
This commit is contained in:
parent
813d7cfc51
commit
b637ce5df9
|
@ -1,6 +1,3 @@
|
|||
body {
|
||||
}
|
||||
|
||||
.navbar {
|
||||
height: 50px !important;
|
||||
min-height: 49px !important;
|
||||
|
|
|
@ -58,7 +58,7 @@ hljs.initHighlightingOnLoad();
|
|||
var MDR = {
|
||||
meta: null,
|
||||
md: null,
|
||||
sanitize: true, // Override
|
||||
sanitize: false, // Override
|
||||
parse: function(md){ return marked(md); },
|
||||
convert: function(md, sanitize){
|
||||
if (this.sanitize !== null) {
|
||||
|
@ -75,9 +75,17 @@ var MDR = {
|
|||
if (sanitize) {
|
||||
// Causes some problems with inline styles
|
||||
html = html_sanitize(html, function(url) {
|
||||
if(/^(\/|https?:\/\/)/.test(url)) {
|
||||
return url
|
||||
try {
|
||||
var prot = decodeURIComponent(unescape(url))
|
||||
.replace(/[^\w:]/g, '')
|
||||
.toLowerCase();
|
||||
} catch (e) {
|
||||
return '';
|
||||
}
|
||||
if (prot.indexOf('javascript:') === 0) {
|
||||
return '';
|
||||
}
|
||||
return prot;
|
||||
}, function(id){
|
||||
return id;
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue