trim empty text nodes - partially fix bug in chrome & increase rendering time