1. dwaiter
  2. django-ckeditor

Commits

Steve Losh  committed 1b9e50a

Strip trailing <br/>s to fix the Firefox bug.

  • Participants
  • Parent commits b32f898
  • Branches default

Comments (0)

Files changed (1)

File ckeditor/widgets.py

View file
+import re
+
 try:
     import simplejson as json
 except ImportError:
             'ckeditor/ckeditor_script.html', context
         ))
 
+    def value_from_datadict(self, data, files, name):
+        val = data.get(name, u'')
+        r = re.compile(r"""(.*?)(\s*<br\s*/?>\s*)*\Z""", re.MULTILINE | re.DOTALL)
+        m = r.match(val)
+        return m.groups()[0].strip()
+
     class Media:
         js = (
             MEDIA_URL.rstrip('/') + '/ckeditor/ckeditor.js',