Docs tweaks. Linkify hashtags.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4034 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2022-11-12 03:06:29 +00:00
parent 0d23294d42
commit 1140c5ddc7
8 changed files with 103 additions and 7 deletions

View File

@@ -8,7 +8,7 @@ async function loadDocument(name) {
<style>body { background: #ccc; }</style>`;
var md = utf8Decode(await getFile(name + '.md'));
if (!md) {
md = "File not found.";
md = `File not found: ${JSON.stringify(name)}.`;
}
var parsed = new commonmark.Parser().parse(md);
var html = new commonmark.HtmlRenderer().render(parsed);
@@ -22,7 +22,7 @@ async function main() {
core.register('message', function(message) {
if (message.event == 'hashChange') {
loadDocument(message.hash.substring(1));
loadDocument((message.hash || '#index').substring(1));
}
});