unescaping before escaping html to fix the json attributes of the elements being double encoded