I have a couple of suspicions about what's going on, but could you post an "after" ZIP of those two files as well, so I can see exactly what the routine's doing to them?
Meanwhile, as a workaround, you might try running the book through the "unpretty" routine first. I have a hunch that the <div></div><div/> line is causing some of the trouble, and passing the book through "unpretty" should split that up so it can be handled correctly.
It's a hack, but it may get the job done until I'm back on my feel and able to look at it in depth.
|