Back to projects

03 / Project

Markdown Workbench

Extract a leading H1 and store the body as Markdown so the source stays editable.

  • Markdown
  • markdown-it
  • Node.js

Goal

Import drafts while preserving headings, lists, and code blocks.

Implementation

Extract a leading H1 and store the body as Markdown so the source stays editable.

Try it

Import a file with a title, a list, and a code block, then verify that the preview links to each heading.

Plain Text
const html = markdown.render(source);
Related article Keeping structure when importing Markdown