1. ajung
  2. pp.client-plone

Commits

ajung  committed d92b0e3

added shitHeadings

  • Participants
  • Parent commits 057b8f4
  • Branches master

Comments (0)

Files changed (1)

File pp/client/plone/browser/transformations.py

View file
             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)
+