Add a space at the end of some inline elements as well
Trim text result in HTML highlight
Small performance improvements