Data & Serialization
Extracting, saving, and loading content in JSON, HTML, or Markdown formats.
JSON (Recommended)
The most robust way to store Edra's content is by using TipTap's native JSON format. JSON perfectly captures all nested attributes, extensions, node configurations (like image alignments or cell widths in tables), and custom marks.
Why JSON over HTML?
HTML serialization relies on parsing tags and attributes, which can sometimes result in lost data if the DOM changes or if specific inline styles are stripped by sanitizers. JSON provides a guaranteed 1:1 mapping of your editor state.
HTML
If you need to render the document's content in an email template or a simplified frontend reader, extracting it as raw HTML is incredibly useful.
Markdown
Edra integrates @tiptap/markdown, allowing seamless conversion between Markdown and
the rich text editor state. This is highly useful for Git-backed CMSs or legacy integrations.
Note that Markdown does not natively support all of Edra's advanced extensions (like media alignment, custom iframe styling, or text colors). When serializing to Markdown, these advanced attributes may be stripped.