Configs2026年7月17日·1 分钟阅读

Summernote — Simple WYSIWYG Rich Text Editor

A lightweight jQuery and Bootstrap-based WYSIWYG editor that enables rich text editing with drag-and-drop images, tables, and code views in any web application.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
Summernote Overview
直接安装命令
npx -y tokrepo@latest install 05e660fd-819b-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

Introduction

Summernote is an open-source WYSIWYG editor built on top of jQuery and Bootstrap. It provides a clean toolbar for formatting text, inserting images via drag-and-drop, embedding videos, and editing raw HTML, making it a practical choice for CMS backends, admin panels, and content management forms.

What Summernote Does

  • Renders a rich text toolbar with bold, italic, lists, links, and heading controls
  • Supports drag-and-drop and paste image upload with configurable callbacks
  • Provides a code view toggle for direct HTML editing
  • Offers an API for programmatic content manipulation and event hooks
  • Works with Bootstrap 3, 4, and 5 or in a standalone Lite mode without Bootstrap

Architecture Overview

Summernote attaches to a contentEditable div and intercepts user interactions through an event-driven module system. Each toolbar button maps to a module (e.g., style, image, link) that manipulates the DOM via document.execCommand or custom range-based operations. A plugin architecture allows third-party extensions to register custom buttons, dialogs, and behaviors.

Self-Hosting and Configuration

  • Include jQuery and Bootstrap CSS/JS, then add the Summernote CSS and JS files
  • Initialize with $(selector).summernote({ height: 300 }) and customize toolbar buttons
  • Configure image upload callbacks via onImageUpload to send files to your server
  • Use summernote-lite for a Bootstrap-free version with built-in styles
  • Install plugins as separate JS files that hook into the module system

Key Features

  • Zero-config setup: a single line of JavaScript activates the editor
  • Table creation and editing with row/column management
  • Custom toolbar layout with configurable button groups
  • Multilingual support with community-contributed language packs
  • Extensible plugin ecosystem for features like emoji, math, and spell check

Comparison with Similar Tools

  • TinyMCE — more feature-rich with premium plugins but requires a license for advanced features; Summernote is fully open source
  • CKEditor 5 — modern block-based architecture with a steeper integration curve; Summernote is simpler to drop in
  • Quill — framework-agnostic with a document model (Delta); Summernote stays closer to raw HTML
  • Tiptap — headless editor built on ProseMirror; more flexible but requires building your own UI

FAQ

Q: Does Summernote require jQuery? A: Yes, Summernote depends on jQuery. The Lite build removes the Bootstrap dependency but still needs jQuery.

Q: Can I customize the toolbar? A: Yes. Pass a toolbar array in the options to include only the button groups you need.

Q: How do I handle image uploads server-side? A: Use the onImageUpload callback to intercept dropped or pasted images and send them to your API via AJAX, then insert the returned URL.

Q: Is Summernote accessible? A: It provides basic keyboard shortcuts and ARIA attributes, though full WCAG compliance depends on your integration.

Sources

讨论

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

相关资产