Some wiki link fixes. Not enough.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4815 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
Cory McWilliams 2024-01-28 23:54:28 +00:00
parent 72369ab745
commit 244a752ae1
3 changed files with 8 additions and 8 deletions

View File

@ -1,5 +1,5 @@
{
"type": "tildefriends-app",
"emoji": "📝",
"previous": "&qrcrBeaWg89ikgql9hXdr68krkg+5NZkmwTbpodEW4U=.sha256"
"previous": "&/wl8HE2jZShRXTYEVYRrK3pjHwi41Wbxl9HoSJaQP6Y=.sha256"
}

View File

@ -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() {
<h1>${wiki_name}: ${wiki_doc_name}</h1>
<div>${markdown(md)}</div>
`,
content_type: 'text/html',
content_type: 'text/html; charset=utf-8',
status_code: 200,
});
} else {

View File

@ -28,15 +28,13 @@ class TfWikiDocElement extends LitElement {
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 = `#${this.wiki?.name}/${node.destination}`;
}
} else if (node.type == 'image') {
if (node.destination.startsWith('&')) {
node.destination = '/' + node.destination + '/view';
}
}
}
}