Skip to content

Commit

Permalink
fix quoto bug
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Dec 20, 2013
1 parent 3e047ef commit e1971f6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ entities = new Entities();
module.exports = function(word) {
request.get(SOURCE['iciba'] + encodeURIComponent(word), function (error, response, body) {
if (!error && response.statusCode == 200) {
var data = JSON.parse(entities.decode(parser.toJson(body))).dict;
// escape " -> '
body = body.replace(/"/g, ''');
// iciba need twice decode ...
var data = JSON.parse(entities.decode(entities.decode(parser.toJson(body)))).dict;
print.iciba(data);
}
});
Expand Down

0 comments on commit e1971f6

Please sign in to comment.