How to filter HTML kindeditor online text editor

Source: Internet
Author: User
Tags tag name

Problems encountered when using the Kindeditor text editor, the customer directly from Excel paste text content into the text editor (can be lazy), and then do not adjust the contents of the paste directly saved (you dare not lazy)! I can only yell at him for this kind of silent behavior, and I'll make a label filter, so you won't have a problem with the paste. Who provoked the client).

The filtering method is also simple:

Kindeditor.ready (function  (K) {            = k.create (' textarea[name= "content"] ', {                  True,// whether to turn on filter mode            }) ;

The default filtermode is off, first set FilterMode to True, and then increase htmltags to specify the HTML tags and attributes to keep . The hash array key is the HTML tag name, value is an array of HTML attributes, "." The starting property represents the Style property. Data type: Object

Kindeditor.ready (function(K) {editor= K.create (' textarea[name= ' content "] ', {filtermode:true,//whether to turn on filter mode                htmltags: {font: [' ID ', ' class ', ' color ', ' size ', ' face ', '. Background-color '], div: [' ID ', ' class ', ' Align ', '. Border ', '. Margin ', '. padding ', '. Text-align ', '. Color ',                        '. Background-color ', '. Font-size ', '. font-family ', '. Font-weight ', '. Background ',                        '. Font-style ', '. Text-decoration ', '. Vertical-align ', '. Margin-left '], a: [' ID ', ' class ', ' href ', ' target ', ' name '], embed: [' ID ', ' class ', ' src ', ' width ', ' height ', ' type ', ' Loop ', ' autostart ', ' quality ', '. Width ', '. Height ', ' align ', ' Allowscrip Taccess '], img: [' ID ', ' class ', ' src ', ' width ', ' height ', ' border ', ' Alt ', ' title ', ' Align ', '. Width ', '. Height ', '. Border '],                    ' P,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6 ' : [                        ' ID ', ' class ', ' Align ', '. Text-align ', '. Color ', '. Background-color ', '. Font-size ', '. font-family ', '. Background ',                        '. Font-weight ', '. Font-style ', '. Text-decoration ', '. Vertical-align ', '. Text-indent ', '. Margin-left '], pre: [' ID ', ' class '], hr: [' ID ', ' class ', '. Page-break-after '],                    ' Br,tbody,tr,strong,b,sub,sup,em,i,u,strike,s,del ': [' id ', ' class '], iframe: [' ID ', ' class ', ' src ', ' frameborder ', ' width ', ' height ', '. Width ', '. Height ']            }           });});

How to filter HTML kindeditor online text editor

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.