mirror of
https://github.com/aljazceru/pear-docs.git
synced 2025-12-17 14:34:19 +01:00
standard fixes
This commit is contained in:
@@ -77,7 +77,6 @@ customElements.define('docs-viewer', class extends HTMLElement {
|
||||
this.load(evt.target.pathname)
|
||||
})
|
||||
|
||||
|
||||
window.addEventListener('click', async (evt) => {
|
||||
evt.preventDefault()
|
||||
if (evt.target?.tagName !== 'A') return
|
||||
@@ -101,7 +100,6 @@ customElements.define('docs-viewer', class extends HTMLElement {
|
||||
}
|
||||
const docsViewer = document.querySelector('docs-viewer')
|
||||
await docsViewer.load(evt.state.page, { back: true })
|
||||
return
|
||||
})
|
||||
|
||||
const config = global[Symbol.for('pear.config')] || {}
|
||||
@@ -115,7 +113,7 @@ customElements.define('docs-viewer', class extends HTMLElement {
|
||||
async load (page, opts = {}) {
|
||||
const html = await fetch(page)
|
||||
const text = await marked.parse(await html.text())
|
||||
this.panel.querySelector('slot').innerHTML = text, { headerIds: false, mangle: false }
|
||||
this.panel.querySelector('slot').innerHTML = text
|
||||
this.panel.style.display = ''
|
||||
this.status.style.display = 'none'
|
||||
if (!opts.back) history.pushState({ page }, null)
|
||||
|
||||
Reference in New Issue
Block a user