MatthewMueller/cheerio — pull request #324 by ysmood (2013-12-11 07:46:24+00:00)
Title: Replace the  and  with the underscore's html escape/unescape function.

Replace the `utils.decode` and `utils.encode` with the underscore's html escape/unescape function. Much faster and more stable.

For example, when a tag's attribute contains Chinese characters, the `$.html()` will produce unexpected value.

cheerio = require('cheerio');
$ = cheerio.load('

');

console.log($.html());
// Result: '

'

The result `你好世界` is not what it expected to be. You should only escape html special chars in attributes, such as these `<>"&';` , not all utf-8 chars.