fixes #18 relative link bug
This commit is contained in:
parent
813d7cfc51
commit
b637ce5df9
3 changed files with 12 additions and 7 deletions
|
@ -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;
|
||||
});
|
||||
|
|
2
setup.py
2
setup.py
|
@ -8,7 +8,7 @@ with open('README.md') as f:
|
|||
with open('requirements.txt') as f:
|
||||
required = f.read().splitlines()
|
||||
|
||||
VERSION = '0.1.9'
|
||||
VERSION = '0.1.10'
|
||||
|
||||
CLASSIFIERS = [
|
||||
'Intended Audience :: Developers',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue