From 5d9df85826a432dcc837996942b279937ba7c80f Mon Sep 17 00:00:00 2001 From: Sam Ruby Date: Tue, 21 Sep 2010 10:29:24 -0400 Subject: [PATCH] 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 --- filters/minhead.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filters/minhead.py b/filters/minhead.py index b9c225e..056481b 100644 --- a/filters/minhead.py +++ b/filters/minhead.py @@ -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)