SunEditor is a lightweight, fast, and extensible WYSIWYG (What You See Is What You Get) web editor built entirely with vanilla JavaScript. It is designed for creating structured content such as articles, documentation, and emails, focusing on consistency and content validation. The current stable version is 3.1.2, with the project actively maintained and receiving regular bug fixes and enhancements. A major rewrite in version 3.0.2 completely revamped the codebase, introduced a modular plugin system, and dropped support for Internet Explorer. SunEditor boasts no external dependencies, offers a responsive user interface, and is easily integrated into modern web application frameworks like React, Vue, and Svelte. Its rich plugin ecosystem includes features like advanced table editing, LaTeX support, drawing tools, code blocks with language selectors, Markdown view mode, and built-in media galleries. It distinguishes itself by providing a robust, highly customizable editing experience without the overhead of external libraries.
npm install suneditorVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to initialize SunEditor on a textarea element, including core plugins, English language pack, and a common toolbar configuration. It showcases the modular setup of the editor.
Review the official SunEditor v3 documentation and migration guides. Re-evaluate plugin imports and initialization logic. Dropped support for Internet Explorer in v3.
If using the mention functionality, update your editor configuration to use the `autocomplete` option and its `triggers` object for per-trigger settings.
Update your import statements to use ES module syntax (e.g., `import suneditor from 'suneditor';`). Ensure your project's build setup (Webpack, Rollup, Vite, etc.) is configured to transpile or handle ESM.
Ensure your target audience uses supported browser versions, or include necessary polyfills if broader compatibility is required. Consult browser compatibility tables for specific APIs.
It is strongly recommended to upgrade to SunEditor v3.x or at least to v2.47.10 (if still on v2) or newer to mitigate this critical XSS vulnerability. Do not use older versions in production.
Ensure all desired plugins are imported (e.g., `import plugins from 'suneditor/src/plugins';`) and passed correctly to the `suneditor.create()` call, typically within the `plugins` array in the options object.
Ensure you are using ES module imports: `import suneditor from 'suneditor';`. If using TypeScript, check `tsconfig.json` for `moduleResolution` settings.
Verify that all plugins corresponding to the features you intend to use are imported from `suneditor/src/plugins` and correctly passed in the `plugins` array when calling `suneditor.create()`.
Add `import 'suneditor/dist/css/suneditor.min.css';` to your entry point. Ensure your build tool (e.g., Webpack, Vite, Parcel) has appropriate loaders (e.g., `style-loader`, `css-loader`) configured to handle CSS imports.
Upgrade SunEditor to version 2.47.10 (if staying on v2.x) or, preferably, to the latest v3.x release to ensure all known security patches are applied.
No dependency data recorded yet.