Minimalistic markdown editor web component
  • TypeScript 86.5%
  • Rust 5.4%
  • Shell 4.5%
  • HTML 3.6%
Find a file
2026-07-24 09:09:59 +02:00
public initial commit 2026-07-03 09:19:05 +02:00
src fix: hide new icon 2026-07-21 19:23:28 +02:00
wasm-md docs: add first draft of README and License 2026-07-09 00:11:00 +02:00
.editorconfig initial commit 2026-07-03 09:19:05 +02:00
.gitignore initial commit 2026-07-03 09:19:05 +02:00
index.html feat: handle enter with unordered lists 2026-07-10 21:11:51 +02:00
LICENSE docs: add first draft of README and License 2026-07-09 00:11:00 +02:00
package.json build: bump version 2026-07-24 09:09:59 +02:00
pnpm-lock.yaml refactor: remove Lit dependency 2026-07-12 11:22:51 +02:00
pnpm-workspace.yaml build: add workspace structure 2026-07-12 08:17:39 +02:00
publish_to_npm.sh fix: fix hashbang 2026-07-12 08:20:19 +02:00
README.md refactor: remove Lit dependency 2026-07-12 11:22:51 +02:00
tsconfig.json build: update tsconfig.json to include all lib files 2026-07-21 19:33:34 +02:00
vite.config.ts build: externalize lit 2026-07-12 08:28:11 +02:00

Märkchen Editor

A tiny web component for creating a markdown editor, powered by Rust with WebAssembly (wasm-bindgen/wasm-pack).

Component: <maerkchen-editor>

Simple editor with toolbar for common formatting actions (bold, italic, lists, etc.) and an automatic preview window.

Rationale

Most JS Rich Text or Markdown editors are massive, have huge amounts of enterprise functionality and include tens to hundreds of NPM dependencies. I built this for my personal projects to keep it really simple.

  • no external dependencies
  • renders a <textarea> with a preview and not much more
  • drop it in a <form> and it might work (will test in production later)
  • alternatively, use as web component and read the reactive value with your favorite JS framework
  • toolbar does nothing fancy, just helps with formatting a bit

Non-features

  • Syntax highlighting for the markdown source
  • ultra fancy styling for the output

things to improve / caveats

  • markdown handling and HTML sanitizing happens in Wasm, so the bundle is unfortunately not that tiny - TODO
  • more outside styling possibilities

Properties

Property Type Description
markdownText string The raw markdown content. (Reflected)
label string The label text displayed above the editor.
formElementName string The name attribute for the internal textarea.
required boolean Sets whether the input field is marked as required.

Basic Usage

Include the script and use the element in your HTML:

<maerkchen-editor
    label="Write a story"
    markdownText="Welcome to the world of **Märkchen**!"
    formElementName="story_content"
    required
>
</maerkchen-editor>

Why "Märkchen"?

All English combinations for "small/tiny" and "Mark" were taken, so I used the diminutive form of my mother tongue German. Nur echt mit dem Umlaut.