JS: filter to HTML entities before comparing