Clone this repository
For self-hosted knots, clone URLs may differ based on your setup.
Download tar.gz
The SPA shell now dispatches a 'odoc-spa-loaded' custom event on
document after all external scripts from the fetched page have
loaded and inline scripts have executed. Extensions listen for
this event instead of polling for CDN library availability.
This replaces the unreliable polling approach — the MutationObserver
fires before CDN scripts load, and no further mutations occur to
trigger re-rendering. The custom event fires at exactly the right
moment: after content is swapped AND all scripts are ready.
Updated mermaid, dot, and msc extensions to use the new event.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The MutationObserver only fires on future mutations. When the init
script loads after content swap (SPA), the content is already in the
DOM and no mutations will fire. Start polling for the CDN library
immediately from init(), not just from the observer callback.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>