mirror of
https://github.com/Hopiu/django-markdownx.git
synced 2026-05-11 06:43:10 +00:00
Correct attrs handling
This commit is contained in:
parent
37258c47fb
commit
38d1126cbc
1 changed files with 3 additions and 1 deletions
|
|
@ -9,7 +9,9 @@ from .settings import MARKDOWNX_EDITOR_RESIZABLE
|
|||
class MarkdownxWidget(forms.Textarea):
|
||||
|
||||
def render(self, name, value, attrs=None):
|
||||
if 'class' in attrs.keys():
|
||||
if attrs is None:
|
||||
attrs = {}
|
||||
elif 'class' in attrs:
|
||||
attrs['class'] += ' markdownx-editor'
|
||||
else:
|
||||
attrs.update({'class':'markdownx-editor'})
|
||||
|
|
|
|||
Loading…
Reference in a new issue