Simplified Html::trimText().

Proposed fix for #2018