Fix router (#39)

* on click, do not add route if included in pathname

* corrected readme tools table links

* remove code blocks inside links

* corrected hypercore and hyperwarm links

---------

Co-authored-by: rafapaezbas <rafa@holepunch.com>
This commit is contained in:
rafapaezbas
2024-02-14 14:11:39 +01:00
committed by GitHub
parent 2095b95c23
commit 636b931276
4 changed files with 12 additions and 8 deletions

View File

@@ -71,7 +71,7 @@ customElements.define('docs-viewer', class extends HTMLElement {
async load (page = '/') {
if (page === '/') page = this.entry
const html = await fetch(page)
const text = await marked.parse(await html.text())
const text = await marked.parse((await html.text()).replace(/\[`([^`]+)`\]/g, "[$1]")) // remove backticks inside link, example: [`hypercore`] -> [hypercore]
this.panel.querySelector('slot').innerHTML = text
this.panel.style.display = ''
}