Skip to content

Commit

Permalink
fix index.html: steal tinydocs fetch code for marked
Browse files Browse the repository at this point in the history
  • Loading branch information
prplwtf authored Feb 19, 2024
1 parent ca6aa52 commit d00b268
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions etc/policies/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,21 @@
</style>
<script>
async function render() {
const response = await fetch("/etc/policies.md");
document.querySelector('.markdown-container').innerHTML = marked.parse(response.body);
}
a = '../policies.md'
fetch(a)
.then(b => {
if (!b.ok) {
throw new Error(`Network response was not ok: ${b.status}`);
}
return b.text();
})
.then(markdownContent => {
document.querySelector('.markdown-container').innerHTML = marked.parse(markdownContent);
})
.catch(c => {
console.error('Error fetching the Markdown content:', c);
});
}
render()
</script>

0 comments on commit d00b268

Please sign in to comment.