fixed trim algorithm in TOhtml engine