@abraca/convert

Bullet-proof Markdown ↔ Yjs/TipTap round-trip — canonical converter shared by cou-sh, abracadabra-nuxt, and @abraca/mcp.
23,017
Install
npm install @abraca/convert
Latest Version:2.102.0
License:MIT
Last Updated:Sep 11, 2026
Links: npm
Maintainer: rgby

@abraca/convert

The canonical Markdown ↔ Yjs/TipTap round-trip converter — shared by cou-sh, abracadabra-nuxt, and @abraca/mcp instead of each vendoring its own copy. Zero runtime dependencies (yjs peer-only).

Documentation

Full, code-derived documentation lives in docs/ — the node/mark spec, the universal-meta spec, the conversion API, diff + file-blocks, and a precise fidelity/gotchas reference. It is the source of truth (the old SPEC.md was untrusted and removed).

API

import { populateYDocFromMarkdown, yjsToMarkdown } from "@abraca/convert";
populateYDocFromMarkdown(doc.getXmlFragment("default"), markdown);
const { title, markdown } = /* via */ yjsToMarkdown(fragment, label);

Fragment shape: [documentHeader, documentMeta, ...body]. Also populateYDocFromHtml (needs a global DOMParser), yjsToHtml, yjsToPlainText, structural diff.ts, and the FS-sync file-blocks/ sidecar.

::

Attach-before-fill is load-bearing — Y.XmlText.insert on a detached node reverses text (YATA clock 0). Coverage is partial: several spec nodes/marks have no runtime branch, and frontmatter handles a ~13-key subset. See docs/4.reference/.

License

MIT.

Related Packages

@abraca/nuxt

First-class Nuxt module for the Abracadabra CRDT collaboration platform

22,147
@abraca/junis

Website-builder Nuxt module for the Abracadabra CRDT platform — page-type render...

2,941
@abraca/plugin

Shared plugin contract + registry for @abraca/nuxt and cou-shell.

20,071

Version History

Version Released License
2.102.0 MIT
2.101.0 MIT
2.100.0 MIT
2.99.0 MIT
2.97.0 MIT