commit: 96d1fe71c8fe9757d804881bfc768646b3e8b75b
parent 5ca58d80af0d45c7ed4c534ab8ca027a0b57e08b
Author: Quentin Leonetti <q.leonetti@gmail.com>
Date: Sat, 12 Jan 2019 23:56:56 +0000
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
}