I had exactly the same problems you're discovering. I think finally I was toying with dumping it into the parser with no modification, and then iterating through it node by node and creating a new document, adding paragraphs and newlines where appropriate. That required jumping into recursion, though, which didn't thrill me, and I had a lot of trouble with text nodes vs. elements.
Yeah. I've been trying to do it without creating a new document, but I don't think that's going to work - too hard to keep things in order. I'm trying a second document now; we'll see if that goes any better.
I've been trying out only adding br tags inside inline elements, instead of paragraphs. I might stick with that unless somebody disapproves loudly, since it's a bit more valid. :D
And we're sadly still on Ruby 1.8.7 - moving to 1.9 is a big job, so I'm not sure when we'll get to that.
no subject
Yeah. I've been trying to do it without creating a new document, but I don't think that's going to work - too hard to keep things in order. I'm trying a second document now; we'll see if that goes any better.
I've been trying out only adding br tags inside inline elements, instead of paragraphs. I might stick with that unless somebody disapproves loudly, since it's a bit more valid. :D
And we're sadly still on Ruby 1.8.7 - moving to 1.9 is a big job, so I'm not sure when we'll get to that.