Encode HTML entities before cleaning up search

For issue #212