Skip to content

Commit 5732e21

Browse files
Jayden Smithgasman
authored andcommitted
Allow passing of options into Rich Text Editor.
1 parent e1c3a75 commit 5732e21

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

CONTRIBUTORS.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ Contributors
165165
* Luiz Boaretto
166166
* Jonathon Moore
167167
* Kees Hink
168+
* Jayden Smith
168169

169170
Translators
170171
===========

wagtail/wagtailadmin/rich_text.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,9 @@ def get_rich_text_editor_widget(name='default'):
5454
editor_settings = getattr(settings, 'WAGTAILADMIN_RICH_TEXT_EDITORS', DEFAULT_RICH_TEXT_EDITORS)
5555

5656
editor = editor_settings[name]
57-
return import_string(editor['WIDGET'])()
57+
options = editor.get('OPTIONS', None)
58+
59+
if options is None:
60+
return import_string(editor['WIDGET'])()
61+
62+
return import_string(editor['WIDGET'])(options=options)

0 commit comments

Comments
 (0)