Merge pull request #504 from anandpdoshi/editor-bugfix
Use jquery to remove style attributes in clean_html in editor.js
This commit is contained in:
commit
a35174399e
1 changed files with 6 additions and 5 deletions
|
|
@ -126,15 +126,16 @@ bsEditor = Class.extend({
|
|||
|
||||
var html = this.editor.html() || "";
|
||||
if(!$.trim(this.editor.text()) && !(this.editor.find("img"))) html = "";
|
||||
// html = html.replace(/(<br>|\s|<div><br><\/div>| )*$/, '');
|
||||
|
||||
// remove custom typography (use CSS!)
|
||||
if(this.options.remove_typography) {
|
||||
html = html.replace(/(font-family|font-size|line-height):[^;]*;/g, '');
|
||||
html = html.replace(/<[^>]*(font=['"][^'"]*['"])>/g, function(a,b) { return a.replace(b, ''); });
|
||||
html = html.replace(/\s*style\s*=\s*["']\s*["']/g, '');
|
||||
return html;
|
||||
var tmp = $("<div></div>").html(html);
|
||||
// remove style attributes
|
||||
tmp.find("*").removeAttr("style");
|
||||
html = tmp.html();
|
||||
}
|
||||
|
||||
return html;
|
||||
},
|
||||
|
||||
init_file_drops: function () {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue