Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
S

summernote-cleaner

> 编程语言
Open source

Plugin for Summernote that adds a Button and/or Paste functionality for cleaning MS Word Crud from editor text

200 stars0 likes2 views
WebsiteGitHub

About

Plugin for Summernote that adds a Button and/or Paste functionality for cleaning MS Word Crud from editor text

summernote-cleaner v1.0.9

A plugin for the Summernote WYSIWYG editor.

summernote-cleaner removes the unnecessary and possibly layout breaking Crud that gets added by MSWord, Open Office, and Libre Office Documents.

The plugin can function in a couple of different ways. It can have a Toolbar Button which allows the Cleaning of the Editor's Text, or Pasted Text can be Cleaned when Pasted into the Text Editor.

The plugin can also limit the number of characters, with options to display text and/or HTML count in the status bar area.

Installation

1. Include JS

Include the following code after Summernote:

xml

2. Supported languages

Currently available in English!

3. Summernote options

…

Documentation

action: Options: ( both | button | paste )

  • button = Only cleans via toolbar button.
  • paste = Only cleans when pasting content.
  • both = Does both of the above options.

keepHtml:

  • true = Keeps HTML Markup and put through parser to remove Word Crud.
  • false = Removes tag elements using the text version of the pasted content from the clipboard.

keepTagContents Removes the tag but keeps the contents, e.g. useful for removing links or spans without losing text content

badTags: Remove full tags with contents. Tags listed by name only ['style', 'script'] NB: any tag not present in keepTagContents or badTags will remain

badAttributes: Remove attributes from tags. Attributes listed by name only ['style', 'start']

limitChars: Limits the number of characters in the summernote

  • false or 0 = allows for max input
  • numbers > 0 = limit on number of characters

limitDisplay: Shows in the status area the total html & text characters Options: ( text | html | both )

  • text = text character count only
  • html = html character count only
  • both = both html & text

limitStop: Limits the number of characters set by limitChars.

  • true = stops input
  • false = doesn't stop input

limitType Determines whether the limit is based on the text or html content length. Defaults to text if the option is not provided.

  • text = uses the text content to calculate length for the limit
  • html = uses the html content to calculate length for the limit

imagePlaceholder: Replace pasted images with a nominated placeholder.

Thanks:

  • RichardSquires
    • Several issue regarding parsing text, and updating docs.
  • wheelspin
    • For adding Microsoft Browsers Support, and modifying the alert.
  • Diemen Design
    • Check out our other Summernote Plugins via our main Github page.

CHANGELOG:

v1.0.9

  • Made image placeholder optional (many thanks to DuncanHouston)

v1.0.8

  • Resolved issue where text like `` was accidentally counted as html when pasting from plain text context

v1.0.7

  • Resolved issue in some cases where code view would be out of synch with editor

v1.0.6

  • Added cleanup of data- attributes

v1.0.5

  • Resolved tags/attributes not stripped when over one or more line
  • Resolved spaces disappearing after pasting

v1.0.4

  • Resolved sucess status text always shown after action

v1.0.3

  • Added feature for removing a tag whilst keeping its content

v1.0.2

  • Resolved paste plain text with keepHtml enabled bug
  • Code cleanup

V1.0.1

  • Remove keepOnlyTags, and keepClasses, they were origially intended to be used, but refinement and other options have taken their place.
  • Reformat source looking for typos.
  • Replace Images with a nominated placeholder.
  • Replace alt attributes with data-title and alt used by Summernote.

TODO:

  • Implement Image conversion to base64, and hopefully automatic upload to destination folder.

Issues· 5 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

JavaScriptaddoncleancrudoffice

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言