Permalink
Browse files

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

…nsferring

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
  • Loading branch information...
1 parent bfc12a9 commit 5d9df85826a432dcc837996942b279937ba7c80f @rubys committed Sep 21, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 filters/minhead.py
View
@@ -28,7 +28,7 @@
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)

0 comments on commit 5d9df85

Please sign in to comment.