Merge pull request #254 from hsemarap/readme-change-to-fix-scrambling-of-dom

Readme change to advise about DOM modification effects of parse(). Fixes #250
pull/255/head
Gijs 9 years ago
commit e5a6d628f4

@ -36,6 +36,16 @@ This `article` object will contain the following properties:
* `byline`: author metadata
* `dir`: content direction
### Optional
Readability's `parse()` works by modifying the DOM. This removes some elements in the web page. You could avoid this by passing the clone of the `document` object while creating a `Readability` object.
```
var documentClone = document.cloneNode(true);
var article = new Readability(uri, documentClone).parse();
```
## Tests
To run the test suite:

Loading…
Cancel
Save