ToolActToolAct

Markdown Editor

Editor0 Characters · 0 Words · 0 Lines
Preview
Ln 1, Col 1Markdown
UTF-8

What is Markdown?

Markdown is a lightweight markup language for writing structured content in readable plain text. Headings, lists, links, images, quotes, code blocks, and tables can be expressed with simple characters and later rendered as HTML or other formats. A Markdown editor helps compare source and preview, catch formatting mistakes, and prepare content faster for README files, documentation, blog posts, notes, knowledge bases, changelogs, and product copy. Markdown stays intentionally simple, but platforms support different extensions such as GitHub-Flavored Markdown, frontmatter, task lists, or Mermaid diagrams. Because of that, the final rendering should still be checked in the system where the content will be published.

How to Use

How to use

  1. Enter Markdown text in the left editor
  2. Right panel shows real-time preview
  3. Use toolbar buttons to insert common syntax
  4. Bottom bar displays word, character, line counts
  5. Content auto-saves to browser local storage

Features

HeadingUse # symbols for headings, number of # indicates heading level
BoldUse **text** or __text__ for bold
ItalicUse *text* or _text_ for italic
LinkUse [display text](URL) to create links
ImageUse ![alt text](imageURL) to insert images
CodeUse backticks ` for inline code, triple backticks for code blocks
ListUse - or * for unordered lists, numbers for ordered lists
QuoteUse > symbol for blockquotes

Editing Tips

  • Preview rendering can vary between platforms, so check final output in the target system when using tables, HTML, or extended Markdown features.
  • Auto-save is useful while drafting, but keep a separate copy for important notes before clearing browser data or switching devices.

Use Cases

Writing Markdown with live previewDraft notes, README sections, release notes, or documentation in the left editor while the right pane renders GitHub-flavored Markdown with line breaks enabled. Code blocks are highlighted after the preview library loads, making technical drafts easier to inspect.
Keeping a browser-local writing scratchpadContent is saved to localStorage per locale, so a draft can survive a page refresh without an account or remote save. Because rendering, syntax highlighting, and HTML sanitization all happen in the browser, half-written release notes, internal post-mortems, or unreleased feature descriptions stay on the device. Character, word, and line counts update as you type, which helps when preparing concise changelog entries or trimming article excerpts to a target length.
Editing longer documents with synchronized contextThe editor tracks cursor line and column, inserts spaces for Tab, and syncs scroll position between the source and preview panes. That makes it more comfortable to revise dense Markdown where the rendered section and source section need to stay aligned.
Switching between CommonMark and GFM rendering modesToggle GitHub-flavored Markdown to see tables, task lists, and autolinks render, or switch to stricter CommonMark when drafting for a static site generator with its own flavor. The preview pane makes the difference visible before publishing. CommonMark resolves the original Markdown grammar's ambiguity around nested list indentation and inline code boundaries; GFM extends that base with pipe tables, `~~strikethrough~~`, `- [ ]` task lists, and autolinked URLs, so the same source produces different HTML depending on which spec the renderer implements.
Copying the rendered HTML for paste into a CMSUse the raw HTML output when migrating a draft into WordPress, Confluence, or another editor that accepts pasted HTML. Saves reformatting headings, lists, and tables by hand, while leaving the Markdown source as the canonical record. GFM table column alignment uses the second row's colon placement --- `:---` left, `---:` right, `:---:` center --- and that syntax is not part of CommonMark, so the same source will render as a paragraph on a strict CommonMark-only engine. Fenced code blocks accept a language hint such as ```ts or ```python, which highlight.js matches against its grammar list; footnoted references like `[^1]` with the body defined later only work when the renderer implements that extension.

Technical Principle

Markdown rendering usually has three steps: a tokenizer slices the text into syntactic units like headings, paragraphs, lists, and code blocks; a parser turns the token stream into an abstract syntax tree (AST) per the grammar rules; a renderer walks the AST and outputs the matching HTML. Common JavaScript libraries include marked, markdown-it, remark, and micromark - they differ in bundle size, speed, and extensibility, but all follow the CommonMark spec. CommonMark fixed the original Markdown grammar's ambiguities (e.g. how to indent nested lists, how to find the boundary of inline code) so that different implementations render the same result. On top of CommonMark, GitHub added GFM (GitHub Flavored Markdown), which adds tables, task lists (- [ ]), strikethrough (~~), autolinks, and fenced code blocks; GFM is the de facto standard today, and most modern Markdown tools enable it by default. Code-block syntax highlighting is usually done by highlight.js or Prism.js, which recognize the language tag at render time and tag keywords, strings, and comments with CSS classes that a theme styles in color. To stop user-supplied HTML from triggering XSS, renderers typically pipe the output through DOMPurify or a similar allowlist filter that strips script, iframe, and on* event attributes - so pasting someone else's Markdown can't execute a malicious script.

  • Parsing flow: raw text goes through Tokenizer -> Parser -> Renderer to become HTML, with the AST as the intermediate representation.
  • Standards: CommonMark is the official grammar; GFM extends it with tables, task lists, strikethrough, fenced code blocks, and autolinks.
  • Library comparison: marked is small and fast, markdown-it has a rich plugin ecosystem, and remark sits on the unified ecosystem and is good for document-processing pipelines.
  • Syntax highlighting: highlight.js or Prism.js read the code block's language tag at parse time and tag keywords, strings, and comments with CSS classes.
  • XSS protection: libraries like DOMPurify filter the output HTML against an allowlist, removing script, iframe, and on* event attributes to prevent script injection.
  • Live preview: the editor listens to input events, debounces each change, re-parses, and updates the right-hand DOM via diff to balance responsiveness and performance.

Examples

Headings, Lists, and Code Blocks

# Heading 1

## Heading 2

- List item A
- List item B
  - Nested list item

```javascript
function hello() {
  console.log('Hello Markdown');
}
```

Tables

| Tool    | Type   | Size |
|---------|--------|------|
| Vite    | Build  | Small|
| Webpack | Build  | Large|
| Rollup  | Bundle | Mid  |

Quotes and Links

> "Markdown lets writing return to the content itself."
> -- John Gruber

Reference: [CommonMark Spec](https://commonmark.org)

FAQ

Which Markdown flavor is supported?

Most builds use CommonMark plus GitHub Flavored Markdown extensions: tables, strikethrough, task lists, fenced code blocks with language hints. Some include MathJax/KaTeX for $math$ blocks and Mermaid for diagrams. Check the toolbar for what's available.

Is the document uploaded?

No. Markdown parsing and rendering happen in your browser using a JS library (typically markdown-it or remark). Your draft never leaves the device.

How does the live preview work?

As you type, the source pane is parsed and rendered to HTML in the preview pane. Synced scrolling keeps the two panes aligned by matching paragraph positions. Most builds also support fullscreen and side-by-side toggle.

Can I export the document?

Yes - download as .md (the raw source), HTML (rendered, ready to embed in a web page), or PDF (printed via the browser's print engine). PDF output preserves headings, lists, code blocks, and embedded images. For pixel-precise PDFs, paste the HTML into a real word processor.

Will it save my draft if I close the tab?

Most builds auto-save to localStorage, so reopening the same browser restores the draft. Closing a private window or clearing site data wipes it. For real persistence, export the .md file periodically to your file system or git repo.

Are images uploaded if I paste them?

Some editors store pasted images as inline base64 (visible in the markdown source). Others upload to an image host - check the page behaviour. If privacy matters, save images to your file system first and reference by relative path.

Can I insert tables, math, or diagrams?

GitHub Flavored Markdown tables (| col1 | col2 |) work everywhere. Math blocks ($x^2$) and Mermaid diagrams (```mermaid) need explicit support; check the toolbar for buttons. Where supported, the preview renders them live.