MatthewMueller/cheerio — pull request #384 by kpdecker (2014-02-21 10:01:12+00:00)
Title: Render/Runtime optimizations

Implements a variety of render optimizations:

- Caches rendered output on elements and shortcircuits if available
- Removes duplicate encode/decode cycles for attributes. They are now stored in their literal form and encoded at render.
- Utilize string concat rather than array join

Also fixes thrown error when removeAttr is called with boolean attributes.

```
1) $(...) .attr (key, value) : handle removed boolean attributes:
TypeError: Object false has no method 'replace'
at Object.decodeHTML5 (/Users/kpdecker/dev/public/cheerio/node_modules/entities/index.js:115:15)
at Object.module.exports.decode (/Users/kpdecker/dev/public/cheerio/node_modules/entities/index.js:6:49)
at exports.decode (/Users/kpdecker/dev/public/cheerio/lib/utils.js:42:50)
at getAttr (/Users/kpdecker/dev/public/cheerio/lib/api/attributes.js:41:12)
at exports.attr (/Users/kpdecker/dev/public/cheerio/lib/api/attributes.js:70:10)
```