minhead.py is only picking the first node from the old header and transferring

it to the new header, due to the nodelist being modified. Here's an easy fix.
Props to Geoff Lankow.
http://lists.planetplanet.org/archives/devel/2010-August/002157.html
This commit is contained in:
Sam Ruby 2010-09-21 10:29:24 -04:00
parent bfc12a9ab4
commit 5d9df85826

View File

@ -28,7 +28,7 @@ if first < minhead:
for i in range(6,0,-1):
for oldhead in doc.getElementsByTagName('h%d' % i):
newhead = doc.createElementNS(XHTML_NAMESPACE, 'h%d' % (i+minhead-first))
for child in oldhead.childNodes:
for child in oldhead.childNodes[:]:
newhead.appendChild(child)
oldhead.parentNode.replaceChild(newhead, oldhead)