Commits

Anonymous committed 2810ad3

update the HTML utils not to remove page break elements

  • Participants
  • Parent commits 1381161

Comments (0)

Files changed (2)

File form_extensions/__init__.py

 __version_info__ = {
     'major': 0,
     'minor': 1,
-    'micro': 1,
-    'releaselevel': 'alpha',
-    'serial': 3
+    'micro': 2,
+    'releaselevel': 'beta',
+    'serial': 4
 }
 
+
 def get_version(short=False):
     assert __version_info__['releaselevel'] in ('alpha', 'beta', 'final')
     vers = ["%(major)i.%(minor)i" % __version_info__, ]

File form_extensions/utils.py

         doc = html.fragment_fromstring(text, create_parent=True)
         selection = ','.join(element_replacements.keys())
         for element in doc.cssselect(selection):
-            element.tag = element_replacements[element.tag]
+            style = element.attrib.get('style', '')
+            if 'page-break' not in style:
+                element.tag = element_replacements[element.tag]
         return _tostring(doc)
     else:
         return text