Skip to content

Commit 51a898a

Browse files
drevutskyjrddimon
drevutskyj
authored and
rddimon
committed
add check for tinymce widget attribute class
1 parent cf50944 commit 51a898a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tinymce/widgets.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@ def render(self, name, value, attrs=None):
8080
value = force_text(value)
8181
final_attrs = self.build_attrs(attrs)
8282
final_attrs['name'] = name
83-
final_attrs['class'] = ' '.join(final_attrs['class'].split(' ') + ['tinymce'])
83+
if final_attrs.get('class', None) is None:
84+
final_attrs['class'] = 'tinymce'
85+
else:
86+
final_attrs['class'] = ' '.join(final_attrs['class'].split(' ') + ['tinymce'])
8487
assert 'id' in final_attrs, "TinyMCE widget attributes must contain 'id'"
8588
mce_config = self.get_mce_config(final_attrs)
8689
mce_json = self.get_mce_json(mce_config)

0 commit comments

Comments
 (0)