1. Chris Perkins
  2. c5t


Joseph Tate  committed 59628c9

Don't crash on the pages page if one page has invalid HTML

  • Participants
  • Parent commits 5fe0cab
  • Branches default

Comments (0)

Files changed (1)

File c5t/core/lib/helpers.py

View file
 from c5t.core.model.content import Page
 import os, re
-from tg import config, request
+from tg import config, request, flash
 from tg.util import odict
 import pkg_resources
 def strip_tags(html):
     s = MLStripper()
-    s.feed(html)
+    try:
+        s.feed(html)
+    except Exception, e:
+       flash('An error exists in the page being stripped, nothing done: "%s"' % str(e))
+       return html
     return s.get_data()