Skills2026年5月12日·1 分钟阅读

Vditor — In-Browser Markdown Editor with Three Editing Modes

A browser-based markdown editor supporting WYSIWYG rich text, instant rendering (Typora-like), and split-view preview modes in a single component.

Agent 就绪

这个资产可以被 Agent 直接读取和安装

TokRepo 同时提供通用 CLI 命令、安装契约、metadata JSON、按适配器生成的安装计划和原始内容链接,方便 Agent 判断适配度、风险和下一步动作。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
Vditor
通用 CLI 安装命令
npx tokrepo install 39050b9f-4dfd-11f1-9bc6-00163e2b0d79

Introduction

Vditor is a TypeScript markdown editor that runs entirely in the browser. It stands out by offering three editing modes in one component: classic split-view, WYSIWYG rich text, and instant rendering that shows formatted output inline as you type, similar to Typora.

What Vditor Does

  • Provides three editing modes switchable at runtime: WYSIWYG, instant rendering, and split-view
  • Renders CommonMark, GFM, and extensions like math (KaTeX), Mermaid diagrams, and flowcharts
  • Supports file upload (images, audio, video) with drag-and-drop and paste
  • Offers full toolbar customization with built-in and custom actions
  • Exports content as markdown, HTML, or PDF

Architecture Overview

Vditor uses the Lute engine (written in Go, compiled to WebAssembly) for markdown parsing and rendering. The editor manages three separate editing surfaces that share the same underlying document state. In WYSIWYG mode it uses contenteditable with custom input handling. In instant-rendering mode it performs incremental parsing and inline formatting. The split-view mode pairs a plain textarea with a live HTML preview pane.

Self-Hosting & Configuration

  • Include via CDN or install with npm: npm install vditor
  • Initialize with new Vditor(elementId, options) passing configuration for mode, toolbar, and theme
  • Configure upload endpoints for image and file attachment handling
  • Set language locale (20+ languages supported) via the lang option
  • Customize the toolbar array to add, remove, or reorder editor actions

Key Features

  • Lute-powered markdown parser compiled to WASM for fast in-browser parsing
  • Math formula rendering via KaTeX and diagram support via Mermaid and Graphviz
  • Built-in code syntax highlighting with language auto-detection
  • Outline, word count, and table of contents generation
  • Content security via XSS sanitization of rendered HTML

Comparison with Similar Tools

  • Milkdown — ProseMirror-based and headless; Vditor is a batteries-included drop-in component
  • Tiptap — rich-text focused with extensions; Vditor is markdown-native with three rendering modes
  • Editor.js — block-based editor; Vditor uses traditional document-based markdown editing
  • Typora — desktop app with instant rendering; Vditor brings the same experience to the browser

FAQ

Q: Can I use Vditor with React or Vue? A: Yes. Community wrappers exist for React and Vue, or you can initialize it in a useEffect/onMounted hook.

Q: Does it support collaborative editing? A: Vditor does not have built-in collaboration. You would need to layer a CRDT library on top.

Q: How large is the bundle? A: The full bundle including WASM parser is approximately 3MB. CSS and JS can be loaded from a CDN.

Q: Can I extend the toolbar? A: Yes. Pass custom toolbar items with icons and click handlers in the configuration options.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产