Commits

ajung committed d92b0e3

added shitHeadings

Comments (0)

Files changed (1)

pp/client/plone/browser/transformations.py

             new_level = level + heading_levels_used.index(heading_level) 
             heading.tag = 'h%d' % new_level
 
+@registerTransformation
+def shiftHeadings(root):
+    """ H1 -> H2, H2 -> H3.... """
+    for node in root.xpath(xpath_query(ALL_HEADINGS)):
+        level = int(node.tag[1:])
+        node.tag = 'h%d' % (level+1)
+