Commits

moberley  committed 88dc240

Fix missing field name attribute in editor template.

  • Participants
  • Parent commits c3afc5a

Comments (0)

Files changed (2)

File pagedown/templates/pagedown/editor.html

-<div class="wmd-panel"><!-- {{ final_attrs|safe }} -->
+<div class="wmd-panel">
   <div id="wmd-button-bar-{{ id }}"></div>
-  <textarea id="wmd-input-{{ id }}" class="wmd-input">{{ value }}</textarea>
+  <textarea id="wmd-input-{{ id }}" class="wmd-input" {{ final_attrs|safe }}>{{ value }}</textarea>
 </div>
 <div id="wmd-preview-{{ id }}" class="wmd-panel wmd-preview"></div>
 <script type="text/javascript">

File pagedown/widgets.py

     def render(self, name, value, attrs={}):
         if value is None: value = ""
         final_attrs = self.build_attrs(attrs, name=name)
+        final_id = final_attrs["id"]
+        del final_attrs["id"]
         return mark_safe(render_to_string(self.template, {
             "final_attrs": flatatt(final_attrs),
             "value": conditional_escape(force_unicode(value)),
-            "id": final_attrs["id"],
+            "id": final_id,
         }))