From 63f59beca34d3a4921dc5e70788000be6b934b83 Mon Sep 17 00:00:00 2001 From: Patrick Forringer Date: Sun, 14 Oct 2018 15:19:22 -0500 Subject: [PATCH] Update widget render attrs with attrs from widget instance before render --- markdownx/widgets.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/markdownx/widgets.py b/markdownx/widgets.py index 4ecb076..3e78c86 100755 --- a/markdownx/widgets.py +++ b/markdownx/widgets.py @@ -54,11 +54,13 @@ class MarkdownxWidget(forms.Textarea): .. Note:: Not accepting ``renderer`` is deprecated in Django 1.11. """ + attrs.update(self.attrs) + attrs.update(self.add_markdownx_attrs(attrs)) + if is_post_10: return super(MarkdownxWidget, self).render(name, value, attrs, renderer) attrs = self.build_attrs(attrs, name=name) - attrs.update(self.add_markdownx_attrs(attrs)) widget = super(MarkdownxWidget, self).render(name, value, attrs)