Simplified Html::trimText(). Proposed fix for #

Proposed fix for #2018