Let HTML escaping functions take an input range instead of only a string.
Adjust whitespace to follow the code conventions.