Skip to main content
SuperDoc is a Word editor that accepts multiple content formats as input. All content is normalized into Word’s document model internally.

Supported formats

HTML and Markdown imports preserve structure (headings, lists, links, tables) but strip CSS styles.

Importing content

At initialization

Pass content when creating the SuperDoc instance.
string | File | Blob | Object
The document to load. Strings are treated as URLs. Files and Blobs are used directly.
string
HTML content to initialize the editor with. Requires a document for styles.
string
Markdown content to initialize the editor with. Requires a document for styles.
Object
ProseMirror JSON to override the document content with.

After initialization

Insert content into an existing document using editor commands.
string | Object
required
The content to insert. String for html, markdown, and text. ProseMirror JSON object for schema.
string
Content type: 'html', 'markdown', 'text', or 'schema'

Exporting content

DOCX export

superdoc.export() triggers a browser download by default. If you need the raw Blob (e.g. to upload to a server), pass triggerDownload: false — otherwise you’ll get a duplicate download.
string[]
default:"['docx']"
Formats to export
string
default:"'external'"
'external' to include comments, 'clean' to remove all comments
string
Custom filename without extension
boolean
default:"true"
Whether to automatically trigger a file download. Set to false to get a Blob back instead.
boolean
default:"false"
Export as final version (applies tracked change mode)
string
Color for field highlights in the exported document
Blob[]
default:"[]"
Additional files to bundle. When multiple files are exported, they are zipped together.
string[]
default:"[]"
Filenames for additional files

HTML export

HTML export is structure-only. Custom CSS styling and Word-specific formatting are not included.

JSON export

JSON export preserves the full document structure and can be re-imported with jsonOverride.

Markdown export

HTML element mapping

CSS classes, IDs, colors, fonts, margins, and other styling are stripped on import.

Markdown element mapping

Supported:
  • Headings (# through ######)
  • Bold/italic (**bold**, *italic*)
  • Ordered and unordered lists
  • Links [text](url)
  • Images ![alt](url)
  • Code blocks
  • Blockquotes >
Not supported:
  • Tables, footnotes, task lists, custom syntax extensions