forked from cory/tildefriends
		
	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:
		| @@ -1,5 +1,5 @@ | |||||||
| { | { | ||||||
|   "type": "tildefriends-app", |   "type": "tildefriends-app", | ||||||
|   "emoji": "📝", |   "emoji": "📝", | ||||||
|   "previous": "&qrcrBeaWg89ikgql9hXdr68krkg+5NZkmwTbpodEW4U=.sha256" |   "previous": "&/wl8HE2jZShRXTYEVYRrK3pjHwi41Wbxl9HoSJaQP6Y=.sha256" | ||||||
| } | } | ||||||
| @@ -10,7 +10,9 @@ function markdown(md) { | |||||||
| 	while ((event = walker.next())) { | 	while ((event = walker.next())) { | ||||||
| 		let node = event.node; | 		let node = event.node; | ||||||
| 		if (event.entering) { | 		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 && | 				if (node.destination.indexOf(':') == -1 && | ||||||
| 					node.destination.indexOf('/') == -1) { | 					node.destination.indexOf('/') == -1) { | ||||||
| 					node.destination = `${node.destination}`; | 					node.destination = `${node.destination}`; | ||||||
| @@ -57,7 +59,7 @@ async function main() { | |||||||
| 				<h1>${wiki_name}: ${wiki_doc_name}</h1> | 				<h1>${wiki_name}: ${wiki_doc_name}</h1> | ||||||
| 				<div>${markdown(md)}</div> | 				<div>${markdown(md)}</div> | ||||||
| 			`, | 			`, | ||||||
| 			content_type: 'text/html', | 			content_type: 'text/html; charset=utf-8', | ||||||
| 			status_code: 200, | 			status_code: 200, | ||||||
| 		}); | 		}); | ||||||
| 	} else { | 	} else { | ||||||
|   | |||||||
| @@ -28,15 +28,13 @@ class TfWikiDocElement extends LitElement { | |||||||
| 		while ((event = walker.next())) { | 		while ((event = walker.next())) { | ||||||
| 			let node = event.node; | 			let node = event.node; | ||||||
| 			if (event.entering) { | 			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 && | 					if (node.destination.indexOf(':') == -1 && | ||||||
| 						node.destination.indexOf('/') == -1) { | 						node.destination.indexOf('/') == -1) { | ||||||
| 						node.destination = `#${this.wiki?.name}/${node.destination}`; | 						node.destination = `#${this.wiki?.name}/${node.destination}`; | ||||||
| 					} | 					} | ||||||
| 				} else if (node.type == 'image') { |  | ||||||
| 					if (node.destination.startsWith('&')) { |  | ||||||
| 						node.destination = '/' + node.destination + '/view'; |  | ||||||
| 					} |  | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user