truncate and truncateWords can now preserve HTML

new private method `truncateHtml` now used by `truncate` and `truncateWords`
truncate $asHtml tests
Fixes #6207: Added support for truncating HTML strings using `StringHelper::truncate()` and `StringHelper::truncateWords()`