Skip to content

Commit

Permalink
Added 'valid_elements' to be more in line with the html sanitizer.
Browse files Browse the repository at this point in the history
  • Loading branch information
mworrell committed Jan 4, 2012
1 parent 3b7a737 commit eae64fd
Showing 1 changed file with 33 additions and 12 deletions.
45 changes: 33 additions & 12 deletions modules/mod_admin/lib/js/apps/admin-common.js
Expand Up @@ -2,7 +2,7 @@
----------------------------------------------------------
@package: Zotonic 2009
@Author: Tim Benniks <tim@timbenniks.nl>
@Author: Tim Benniks <tim@timbenniks.nl>
Copyright 2009 Tim Benniks
Expand All @@ -23,7 +23,7 @@ limitations under the License.
tinyInit = {
mode: "none",
theme: "advanced",
theme_advanced_buttons1: "bold,italic,|,bullist,numlist,blockquote,|,justifyleft,justifycenter,justifyright,|,link,unlink,|,cleanup,code,|,formatselect,|,zlink,zmedia",
theme_advanced_buttons1: "bold,italic,|,bullist,numlist,blockquote,|,justifyleft,justifycenter,justifyright,|,link,unlink,|,cleanup,code,|,formatselect,|,zlink,zmedia",
theme_advanced_buttons2: "tablecontrols,outdent,indent",
theme_advanced_buttons3: "",
theme_advanced_buttons4: "",
Expand All @@ -42,22 +42,22 @@ tinyInit = {
gecko_spellcheck: "1",

formats : {
bdo_rtl : {inline : 'bdo', attributes : {dir: 'rtl'}},
bdo_ltr : {inline : 'bdo', attributes : {dir: 'ltr'}}
},
bdo_rtl : {inline : 'bdo', attributes : {dir: 'rtl'}},
bdo_ltr : {inline : 'bdo', attributes : {dir: 'ltr'}}
},

/* Cleanup pasted html code */
paste_auto_cleanup_on_paste : true,
paste_auto_cleanup_on_paste : true,
paste_convert_middot_lists: true,
paste_remove_spans: true,
paste_remove_styles: true,
paste_remove_styles_if_webkit: true,
paste_strip_class_attributes: true,
paste_remove_styles: true,
paste_remove_styles_if_webkit: true,
paste_strip_class_attributes: true,

/* below is a workaround for problem where tinyMCE setEntities skips the ones below and the doesn't initialize the entityLookup array
* which results in an error in the _encode function.
*/
entity_encoding: "raw",
entity_encoding: "raw",
entities: "38,amp,60,lt,62,gt",

accessibility_focus: "1",
Expand All @@ -66,5 +66,26 @@ tinyInit = {
wpeditimage_disable_captions: "",
plugins: "paste,table,zlink,zmedia,autosave,directionality,zbdo",
table_row_limit: 100,
table_col_limit: 10
}
table_col_limit: 10,

/* Adapted valid element list, added some html5 elements, removed controls, object, embed etc */
/* See: http://www.tinymce.com/wiki.php/Configuration:valid_elements */
valid_elements : "@[style|title|dir<ltr?rtl|lang|xml::lang],"
+ "a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title],"
+ "strong/b,em/i,strike,u,"
+ "#p,-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|"
+ "src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,"
+ "-blockquote,-table[border=0|cellspacing|cellpadding|width|frame|rules|"
+ "height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|"
+ "height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,"
+ "#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],"
+ "#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,"
+ "-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],"
+ "dd,dl,dt,cite,abbr,del[datetime|cite],ins[datetime|cite],"
+ "map[name],area[shape|coords|href|alt|target],bdo,"
+ "col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|valign|width],"
+ "dfn,kbd,legend,"
+ "q[cite],samp,small,"
+ "tt,var,big,"
+ "section,header,nav,article,footer,audio,video"
};

0 comments on commit eae64fd

Please sign in to comment.