The codebase is written in JavaScript, using JSDoc for type definitions.
Node.js v14 or higher is required to build and test.
- Polyfills are not included. Make sure your target environment (browser or runtime) natively supports these features.
- Target ECMAScript version: ES2022
- Supported browsers: See Browser Support
- Make sure you're using the latest
masterbranch. Your issue may already be fixed. - Search the open issues and closed issues to avoid duplicates.
- If your issue is new, file a ticket with detailed info, including reproduction steps if possible.
- Check that no one is working on the same thing in open issues.
- For new features or major changes, please open an issue first to gather feedback.
- Use a feature branch (not
master) for your pull request. - Make sure your code passes tests and doesn’t break existing functionality.
We welcome code contributions, bug reports, documentation improvements, or plugin ideas!
- Use the provided ESLint configuration.
- 4-space indentation
- Single quotes (
') for strings
SunEditor allows custom plugins using a flexible API.
📘 Start from the Plugin API Reference
🔍 Or explore the src/plugins/ folder to see real examples.
📦 The dist/ folder is not included in the git repository.
⚙️ It is automatically built and deployed via GitHub Actions after changes are pushed to the release branch.
🛑 Do not build or commit dist/ files manually – this may cause merge conflicts.
✅ The CI/CD pipeline ensures clean and consistent builds for every release.
If you're contributing to framework integrations:
- React: suneditor-react
- Vue: suneditor-vue
💡 Feel free to propose wrappers for other frameworks too!
Need real-time help?
Check out SunEditor Devs AI –
💡 Just paste your code or describe your plugin idea – and get instant support.
A quick overview of the src/ directory:
editor.js: Defines the main Editor class, managing lifecycle, commands, and overall orchestrationsection/: Context management and document setupclass/: Core classes like toolbars, selections, HTML parsing, etc.base/: Undo/redo history, event manager, and shared core logic
- String converters, clipboard helpers, DOM queries
helper/dom/: Low-level DOM operations
- Functional components like:
Modal,ColorPicker,SelectMenu,FileManager, etc.
- Useful for building consistent plugin UIs
- Wraps and initializes the core editor
- Plugins must inherit from this to register correctly
- Modular plugins organized by type:
- Examples:
image,video,link,blockquote, etc.
- Examples:
- Each plugin is isolated and optional
- Language packs in separate JS files
- CSS for editor layout and themes
- SVG icon sets (
icons/defaultIcons.js)
- Includes variants like
dark.css
- Bootstraps and exports the editor instance
# Start local dev server
npm run dev
# Build for development
npm run build:dev
# Build for production
npm run build:prod
# lint
npm run lint
# Auto-fix JavaScript issues
npm run lint:fix-js
# Auto-fix TypeScript issues
npm run lint:fix-ts
# ✅ Run before committing!
# Fix all lint issues (JS + TS)
npm run lint:fix-all
# Build types and update barrels
npm run ts-build
# Sync language files (base: en.js)
npm run i18n-build
# test
npm run testThanks for contributing 💛 You're helping make SunEditor better for everyone!