1. dwaiter
  2. dpcms


Steve Losh  committed a95b476 Merge

Merge the br fix.

  • Participants
  • Parent commits 6fac930, 8835a55
  • Branches default

Comments (0)

Files changed (1)

File pages/widgets.py

View file
 """Django CMS come with a set of ready to use widgets that you can enable
 in the admin via a placeholder tag in your template."""
+import re
 from pages.settings import PAGES_MEDIA_URL, PAGE_TAGGING
 from pages.settings import PAGE_TINYMCE, PAGE_LANGUAGES
 from pages.models import Page
         return rendered + mark_safe(render_to_string(
             'pages/widgets/ckeditor.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 WYMEditor(Textarea):