1 comments

  • deftio 23 minutes ago

    Hi HN-

    This past year I've built and maintained Quikdown, a bidirectional markdown parser and companion editor in pure js, with batteries included fences for rendering rich content.

    Try it live: https://deftio.github.io/quikdown/pages/edit/

    The motivation was working with many different LLM frameworks and wanting to test tool calling and collaborative editing. Often I just wanted a pretty final output with rich support for diagrams, math, or other rendered content but, keep it editable. So a user (often me) could just work on the final (rendered) output while the LLM could see/seek/update/edit just using markdown under the covers. Quikdown editor supports md/split/rendered output and can run headless so you can bring your own UI. MCP support is included as well.

    The Quikdown parser has zero dependencies and is based on regex and outputs HTML with built-in tags for triggering plugins for fences (like Mermaid, Vega-lite, code syntax, music and many more). A separate set of attributes allow tracking of bidirectional content so a user can edit markdown tables, code rendered in highlightjs and many other types in the rendered view. For complex rendered types (like Mermaid or STL) bidirectional support is not included but if you want to take that on there are hooks to support your own efforts.

    While the parser has no dependencies , the editor lazy-loads appropriate libraries for rendering rich content. Supported fences include: Mermaid, MathJax, SVG, CSV/TSV/PSV tables, GeoJSON with live leaflet based pan-and-zoom, Sheet music (via ABC.js), Vega/Vegalite-charts, STL (via threejs), code highlighting (via highlightjs).

    Also included is programmatic undo/redo - so if you are making a closed loop with another output service (LLM or some process) you can roll back content changes that were not desired.

    All inline HTML is escaped by default - no eval() or other unsafe raw parsing of content is allowed and URL sanitization blocks script based urls. However if you are using the editor the plugins which render rich content are left to handle that content on their own and are hence "trusted".

    Quikdown intentionally doesn't cover all of Commonmark compatibility - if you find some portion of the spec isn't covered that you need raise an issue or make a PR and I'll take a look.

    A standalone "air-gapped" build is also provided so you can use quikdown locally with zero cloud support. The standalone build is about 8MB so not recommended for use in online applications.

    Longer write-up: https://deftio.github.io/quikdown/pages/blog/