{"action":"closed","issue":{"url":"https://api.github.com/repos/FreeCodeCamp/freecodecamp/issues/1062","labels_url":"https://api.github.com/repos/FreeCodeCamp/freecodecamp/issues/1062/labels{/name}","comments_url":"https://api.github.com/repos/FreeCodeCamp/freecodecamp/issues/1062/comments","events_url":"https://api.github.com/repos/FreeCodeCamp/freecodecamp/issues/1062/events","html_url":"https://github.com/FreeCodeCamp/freecodecamp/issues/1062","id":90207105,"number":1062,"title":"[Convert HTML Entities] Chai test never passes","user":{"login":"violincounter","id":4188269,"avatar_url":"https://avatars.githubusercontent.com/u/4188269?v=3","gravatar_id":"","url":"https://api.github.com/users/violincounter","html_url":"https://github.com/violincounter","followers_url":"https://api.github.com/users/violincounter/followers","following_url":"https://api.github.com/users/violincounter/following{/other_user}","gists_url":"https://api.github.com/users/violincounter/gists{/gist_id}","starred_url":"https://api.github.com/users/violincounter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/violincounter/subscriptions","organizations_url":"https://api.github.com/users/violincounter/orgs","repos_url":"https://api.github.com/users/violincounter/repos","events_url":"https://api.github.com/users/violincounter/events{/privacy}","received_events_url":"https://api.github.com/users/violincounter/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-06-22T20:39:37Z","updated_at":"2015-06-28T22:46:04Z","closed_at":"2015-06-28T22:46:04Z","body":"Challenge http://www.freecodecamp.com/challenges/bonfire-convert-html-entities has an issue.\r\n\r\nThe following chai test does not pass for a correct conversion:\r\n`assert.strictEqual('<>', '<>', 'should escape characters');`\r\n\r\nI think it should look like this:\r\n`assert.strictEqual(convert('<>'), '<>', 'should escape characters');`\r\n\r\nTo reproduce, press \"Run code\".\r\n\r\nMy code:\r\n\r\n    function convert(str) {\r\n      re = new RegExp('(&|<|>|\"|\\')', 'g');\r\n      str = str.replace(re, function(match) {\r\n        switch (match) {\r\n          case '&':\r\n            return '&amp;';\r\n          case '<':\r\n            return '&lt;';\r\n          case '>':\r\n            return '&gt;';\r\n          case '\"':\r\n            return '&quot;';\r\n          case '\\'':\r\n            return '&apos;';\r\n        }\r\n      });\r\n\r\n      return str;\r\n    }\r\n\r\nReally enjoying the course so far. Thank you!"}}