I'm using tinyMCE 3 (in my django app with django-tinymce). It's a very restricted set of html that I want output and I don't want tinyMCE adding inline styles or span elements.
I've used the valid_elements
parameter for tinyMCE.init()
, but this seems to only effect the html tinyMCE passes to my database - it doesn't seem to control the html in the textarea (spans and inline style are still being added). I want wysiwyg.
I've included my init parameters below (they're in python - django-tinymce passes these to the javascript when tinyMCE is initiated).
TINYMCE_DEFAULT_CONFIG = {
'plugins': "paste",
'paste_remove_styles': 'true',
'paste_remove_styles_if_webkit': 'true',
'paste_strip_class_attributes': 'all',
'content_css': (STATIC_URL + 'css/normalize.css, ' + STATIC_URL +
'css/BrandonG.css, ' + STATIC_URL +
'css/main.css'),
'theme': "advanced",
'theme_advanced_toolbar_location': "top",
'theme_advanced_buttons1': "bold,italic,underline,separator,"
"bullist,separator,outdent,indent,separator,undo,redo,"
"link,unlink",
'theme_advanced_buttons2': "",
'theme_advanced_buttons3': "",
'height': 400,
'valid_elements': "a[!style,href|target=_blank],strong[!style],ul[!style],li[!style],p[!style]"
}
How to I control the html in editing textarea?