Skip to content

    Development documentation — this describes the current development branch. Documented behavior may not exist in the latest release.

    Export and persistence

    This page covers exporting the rendered preview to PDF and exactly what the app stores in your browser.

    Click Export PDF in the header to render the current preview to a PDF file (markdown-preview.pdf). The export always uses the light theme for readability, regardless of the theme you are viewing.

    PDF export is powered by the html2pdf library, which is loaded at runtime from cdnjs.cloudflare.com. This is the one third-party script the app fetches; it is pinned with a Subresource Integrity (SRI) hash and loaded with crossorigin="anonymous" and a no-referrer policy. Two consequences follow:

    • The container’s Content Security Policy explicitly allows cdnjs.cloudflare.com in script-src so the library can load. See Security and privacy.
    • In a fully offline or CDN-blocked environment the library will not load, and clicking Export PDF shows a message that export is unavailable. See Common issues.

    The app uses localStorage (under the namespace com.markdownlivepreview) with bounded expiries. Nothing is stored server-side.

    Stored itemRetentionNotes
    Editor content (last_state)30 daysNot stored while Private mode is on.
    Sync scroll setting365 days
    Theme setting365 daysAlso mirrored to a boot key for flash-free theme on load.
    Private mode setting365 days
    External images setting365 days
    Analytics setting365 daysAlso mirrored to a boot key.

    Expired entries are not returned after their retention window elapses. This is a deliberate change from indefinite persistence.

    To remove everything the app stored, clear site data for the app’s origin in your browser (Application → Storage → Clear site data in Chromium, or the equivalent). For a one-off session with no content saved, enable Private mode before typing.

    • Export: click Export PDF and confirm markdown-preview.pdf downloads with light-theme styling.
    • Persistence: type text, reload, and confirm it is restored (with Private mode off).