MCPcopy
hub / github.com/JiHong88/suneditor

github.com/JiHong88/suneditor @3.1.4 sqlite

repository ↗ · DeepWiki ↗ · release 3.1.4 ↗
2,351 symbols 7,842 edges 555 files 1,516 documented · 64%
README

SunEditor

A lightweight and powerful WYSIWYG editor built with vanilla JavaScript

<a href="https://github.com/JiHong88/SunEditor/blob/master/LICENSE.txt" title="MIT License"><img src="https://img.shields.io/github/license/jihong88/suneditor.svg?style=flat-square" alt="GitHub License"></a>
<a href="https://www.npmjs.com/package/suneditor" title="npm release"><img src="https://img.shields.io/npm/v/suneditor.svg?style=flat-square" alt="npm"></a>
<a href="https://www.npmjs.com/package/suneditor" title="npm month downloads"><img src="https://img.shields.io/npm/dm/suneditor.svg?logo=npm&style=flat-square" alt="npm weekly downloads"></a>
<a href="https://www.jsdelivr.com/package/npm/suneditor" title="jsDelivr CDN month downloads"><img src="https://img.shields.io/jsdelivr/npm/hm/suneditor?label=CDN&style=flat-square" alt="jsDelivr CDN" /></a>
<a href="https://codecov.io/gh/jihong88/suneditor" title="Test coverage"><img src="https://codecov.io/gh/jihong88/suneditor/branch/develop/graph/badge.svg" alt="Test coverage" /></a>

SunEditor supports all modern browsers without dependencies or polyfills.

🌟 Why SunEditor?

SunEditor is a lightweight, fast, and extensible WYSIWYG editor written in pure JavaScript.
It's easy to integrate, highly customizable, and built for modern web applications.

⚡ Key Features

  • No dependencies — Optimized for speed and simplicity
  • Modular architecture — Enable only the plugins you need
  • Responsive UI — Works smoothly on all modern devices
  • Framework-friendly — Easy to use with React, Vue, Svelte, etc.
  • Feature-rich plugin ecosystem, including:
    • @Mentions with autocomplete
    • Advanced table editing & custom layouts
    • Math (LaTeX), drawing, and code block support (with language selector)
    • Markdown view mode (GFM) — edit content as Markdown
    • Built-in media galleries (image, video, audio, file)
    • PDF export, templates, and embedded content (audio/video/iframe)

📝 Content Editing Approach

SunEditor is optimized for structured content (articles, documentation, emails) rather than arbitrary HTML editing. Content is validated and auto-corrected to maintain consistency.

For raw HTML editing needs, see strictMode configuration in the Architecture Guide.

🌤 Try all plugins in Playground

Contributions welcome! Please refer to Contribution Guidelines and check out our open tasks. ⭐


🌍 Browser Support

SunEditor is built to take advantage of modern browser capabilities.
It does not ship with polyfills by default, but you can add them if your project requires broader compatibility.

Works correctly on the following versions or newer.

Browser ≥ Version
Chrome 119 (Oct 2023)
Edge 119 (Nov 2023)
Firefox 125 (Apr 2024)
Safari (macOS, iOS) 17.2 (Dec 2023)
Opera 105 (Nov 2023)
Android WebView 119 (Oct 2023)
Samsung Internet 23.0 (Oct 2023)
Firefox ESR 128 (Jul 2024)

❌ Not Supported : IE, Legacy Edge

📌 Why This Baseline? (Late 2023)

  • This is based on features commonly supported by modern browsers.
  • Most modern web APIs and CSS features are supported reliably in versions after this point.
  • Unless specific compatibility issues arise, you can use it out of the box without additional polyfills.
  • If you need support for older browsers, you can extend it by adding your own polyfills.

📦 Legacy Version (v2-legacy)

* Supported IE11

SunEditor v3 is the latest version.
This section refers to the previous stable version, SunEditor v2.

The v2-legacy branch is no longer actively maintained,
but still available for compatibility with older projects.

👉 v2-legacy branch


🚀 Install & Quick Start

💡 Want to see it in action?
Check out the 🌤 Live Demo 🌤 with full options and examples.

NPM

npm install suneditor --save
import 'suneditor/css/editor'; // Editor UI
import 'suneditor/css/contents'; // For displaying HTML
import suneditor from 'suneditor';

// HTML: 



 or <textarea id="editor"></textarea>
suneditor.create(document.querySelector('#editor'), {
    // options
});

CDN (jsDelivr)

<script src="https://cdn.jsdelivr.net/npm/suneditor@latest/dist/suneditor.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/suneditor@latest/dist/suneditor.min.css" rel="stylesheet" />










<script>
    SUNEDITOR.create(document.querySelector('#editor'), {
        // options
    });
</script>

🔧 Framework Integration

You can use the official wrappers for easier integration:

React – suneditor-react\ Vue – suneditor-vue


📦 Plugins

SunEditor supports a plugin-based architecture.\ You can enable only the plugins you need or even create your own custom ones.

suneditor.create('#editor', {
    plugins: ['font', 'image', 'video'],
    image: {
        uploadUrl: 'https://upload.image',
    },
});

📘 Learn how to build your own plugin →

🤖 Want to build plugins? Get real-time help from SunEditor Devs AI.\ See Contribution Guide for tips and examples.


✨ Contributors

contributors


💎 Sponsors

Backers

Backers on Open Collective

Sponsors

Sponsors on Open Collective


📄 License

SunEditor is an open-source project available under the MIT License.

Extension points exported contracts — how you extend this code

ModuleHueSlider (Interface)
(no doc) [2 implementers]
types/interfaces/contracts.d.ts
ModuleModal (Interface)
(no doc) [1 implementers]
types/interfaces/contracts.d.ts
ModuleController (Interface)
(no doc) [1 implementers]
types/interfaces/contracts.d.ts
ModuleBrowser (Interface)
(no doc) [1 implementers]
types/interfaces/contracts.d.ts
ModuleColorPicker (Interface)
(no doc) [1 implementers]
types/interfaces/contracts.d.ts

Core symbols most depended-on inside this repo

get
called by 2058
src/core/kernel/store.js
set
called by 692
src/core/kernel/store.js
setRange
called by 537
src/core/logic/dom/selection.js
get
called by 362
src/core/logic/dom/html.js
run
called by 311
src/core/logic/shell/commandDispatcher.js
open
called by 299
test/setup.js
get
called by 262
src/core/logic/shell/component.js
replace
called by 201
src/core/logic/panel/finder.js

Shape

Method 1,291
Function 600
Class 454
Interface 6

Languages

TypeScript100%

Modules by API surface

src/modules/contract/Figure.js62 symbols
src/events.js57 symbols
src/core/logic/shell/ui.js51 symbols
src/core/logic/panel/finder.js45 symbols
src/core/event/eventOrchestrator.js43 symbols
src/core/logic/dom/html.js41 symbols
src/plugins/dropdown/table/index.js38 symbols
src/modules/contract/HueSlider.js35 symbols
src/core/logic/shell/component.js35 symbols
src/plugins/modal/video/index.js34 symbols
src/hooks/base.js34 symbols
src/helper/dom/domUtils.js34 symbols

Dependencies from manifests, versioned

@babel/core7.28.4 · 1×
@babel/preset-env7.28.3 · 1×
@octokit/rest21.1.1 · 1×
@playwright/test1.56.0 · 1×
@typescript-eslint/eslint-plugin8.45.0 · 1×
@typescript-eslint/parser8.45.0 · 1×
@webpack-cli/serve3.0.1 · 1×
babel-jest30.2.0 · 1×
babel-loader10.0.0 · 1×
barrelsby2.8.1 · 1×
clean-webpack-plugin4.0.0 · 1×

For agents

$ claude mcp add suneditor \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact