Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

version bump & last resort fix for luin/node-readability#8 #9

Merged
merged 1 commit into from
Sep 18, 2013

Conversation

buley
Copy link
Contributor

@buley buley commented Sep 18, 2013

I experienced some errors with the same type of origin as discussed and resolved in #8

/Users/account/Code/testapp/node_modules/node-readability/src/helpers.js:203
    topCandidate.innerHTML = document.body.innerHTML;
                                          ^
TypeError: Cannot read property 'innerHTML' of null
    at Object.module.exports.grabArticle (/Users/account/Code/testapp/node_modules/node-readability/src/helpers.js:203:43)
    at /Users/account/Code/read/index.js:5:14
    at /Users/account/Code/read/node_modules/jsdom/lib/jsdom.js:252:9
    at process._tickCallback (node.js:415:13)

jsdom apparently doesn't a allow you to create a new BODY tag so there seems no resort but to return an Error when no body tag exists.

Added a test to check for this.

  $ /usr/local/share/npm/bin/mocha test/readability.test.js 

  node-readability
    ✓ should get document (2152ms)
    ✓ should get document with frames (3177ms)
    ✓ should handle the html that missing body tag 
    ✓ should let helpers.grabArticle handle html that's missing a body tag 

  4 passing (5s)

luin added a commit that referenced this pull request Sep 18, 2013
version bump & last resort fix for #8
@luin luin merged commit 0c2af0b into luin:master Sep 18, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants