I have some code which makes an attempt at this and which (mostly) works, as part of my ongoing project to convert all of PG to Palmdoc. Email me, and I'll send you a copy.
Dear Sir,
I am doing a project to convert Gutenberg books into webpages. If you don't mind, could you please share your codes with me?
Thanks,
Mark
my email: markli1968@yahoo.com