Kindeditor is an open source HTML visual editor, mainly used for users to get WYSIWYG editing on the site, compatible with IE, Firefox, Chrome, Safari, opera and other mainstream browsers. Kindeditor is written using JavaScript and can seamlessly interface with programs such as Java,. NET, PHP, ASP, and so on. This is an introduction on the official website.
Home: http://www.kindsoft.net/index.php
Download: http://www.kindsoft.net/down.php
Example: http://www.kindsoft.net/demo.php
In the case of using the Kindeditor text editor, the customer pastes the text directly from Excel into the text editor (can be lazy), and then saves the pasted content directly (you dare not be lazy any more)! For this very silent behavior, I can only yell at him, I do a label filter it, so you paste will not have problems (counselling?) Who provoked the client).
The filtration method is also simple:
Kindeditor.ready (function (K) {
editor = k.create (' textarea[name= ' content '] ', {
filtermode:true,//whether filtering mode is turned on
});
The default filtermode is off state, first set FilterMode to True, and then add Htmltags to specify the HTML tags and attributes to keep. The key of the hash array is the HTML tag name, the 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 open 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 ', ' allowscriptaccess '], 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,de
L ': [' id ', ' class '], iframe: [' id ', ' class ', ' src ', ' frameborder ', ' width ', ' height ', '. Width ', '. Height ']}}; });
The above is a small series to introduce you to the Kindeditor online text editor how to filter HTML, I hope to help!