Skip to content

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

Notifications You must be signed in to change notification settings

zsimple/summernote-cleaner

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 

Repository files navigation

summernote-cleaner

原插件简单的把html转为了text,DOM结构都没了,这里改造一下,比较马虎的完成Word等富文本粘贴,也许可以用tidy来净化一下?

A plugin for the Summernote WYSIWYG editor.

summernote-cleaner removes the unnecessary and possibly layout breaking Crud that gets added to 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.

Installation

1. Include JS

Include the following code after Summernote:

<script src="summernote-cleaner.js"></script>

2. Supported languages

Currently available in English!

3. Summernote options

$('.summernote').summernote({
    toolbar:[
        ['cleaner',['cleaner']], // The Button
        ['style',['style']],
        ['font',['bold','italic','underline','clear']],
        ['fontname',['fontname']],
        ['color',['color']],
        ['para',['ul','ol','paragraph']],
        ['height',['height']],
        ['table',['table']],
        ['insert',['media','link','hr']],
        ['view',['fullscreen','codeview']],
        ['help',['help']]
    ],
    cleaner:[
        element:'.summernote', // The element you use to initialise Summernote.
        time:900, // Time to display the Notification.
        action:'both' // Options: button|both|paste
    ]
});

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%