commit: 1f91af32197fbd605f5627bd6edfd717c86b0a89
parent da3493f6b30bfb315877200a5dd193bb93397bb1
Author: Лu Лinveгa <aliceffekt@gmail.com>
Date: Sun, 13 Jan 2019 11:59:12 +1200
Merge pull request #2 from qleonetti/master
Make runic links accessible
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/lib/runic.js b/scripts/lib/runic.js
@@ -138,7 +138,7 @@ String.prototype.to_markup = function () {
var target = content.indexOf('|') > -1 ? content.split('|')[1] : content
var name = content.indexOf('|') > -1 ? content.split('|')[0] : content
var external = (target.indexOf('https:') > -1 || target.indexOf('http:') > -1 || target.indexOf('dat:') > -1)
- html = html.replace(`{{${content}}}`, external ? `<a href='${target}' class='external' target='_blank'>${name}</a>` : `<a class='local' onclick="Ø('query').bang('${target}')">${name}</a>`)
+ html = html.replace(`{{${content}}}`, external ? `<a href='${target}' class='external' target='_blank'>${name}</a>` : `<a class='local' href="#${target.to_url()}" onclick="Ø('query').bang('${target}')">${name}</a>`)
}
return html
}