function trimHtmlText(text) {
    return text.replace(/^[ \f\n\r\t\v\u1680\u180e\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+|[ \f\n\r\t\v\u1680\u180e\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+$/g, '')
}
Trims a string the same way as String.prototype.trim(), but preserving all non breaking spaces ('\xA0')
@param {string} text
@return {string}