Fix for issue 258


Hi Jonathan,

I needed to fix this bug quite urgently and so I  have not  been able to spend as much time as I would like in the Jsoup code.

It does however feel sane, fixes the issue as I was seeing it and has tests, so even if it is not the best solution it should help.

Thanks for all your effort with Jsoup,
Luke Farrar