diff --git a/apps/wiki.json b/apps/wiki.json index 14dc08d6..493364eb 100644 --- a/apps/wiki.json +++ b/apps/wiki.json @@ -1,5 +1,5 @@ { "type": "tildefriends-app", "emoji": "📝", - "previous": "&qrcrBeaWg89ikgql9hXdr68krkg+5NZkmwTbpodEW4U=.sha256" + "previous": "&/wl8HE2jZShRXTYEVYRrK3pjHwi41Wbxl9HoSJaQP6Y=.sha256" } \ No newline at end of file diff --git a/apps/wiki/handler.js b/apps/wiki/handler.js index c0fe3b93..244bb336 100644 --- a/apps/wiki/handler.js +++ b/apps/wiki/handler.js @@ -10,7 +10,9 @@ function markdown(md) { while ((event = walker.next())) { let node = event.node; if (event.entering) { - if (node.type === 'link') { + if (node.destination?.startsWith('&')) { + node.destination = '/' + node.destination + '/view?filename=' + node.firstChild?.literal; + } else if (node.type === 'link') { if (node.destination.indexOf(':') == -1 && node.destination.indexOf('/') == -1) { node.destination = `${node.destination}`; @@ -57,7 +59,7 @@ async function main() {