Patch from gdt

Process .tail for HTML entities.
More general treatment of the spaces.