Commit Graph

31 Commits

Author SHA1 Message Date
Gijs Kruitbosch
30611cc57f Fix quotes issues in test and benchmark files 2018-07-15 15:43:50 +01:00
Gijs Kruitbosch
f4ab856992 Check for a document being passed
This provides a descriptive error message if no document is passed, and
ignores the first argument if the second argument looks like
a reasonable DOM document instance.
2018-05-01 12:29:22 +01:00
David A Roberts
d60184966c Remove unused URI parameter from constructor 2018-04-26 10:30:15 +01:00
Gijs Kruitbosch
d598baf02b Improve URL handling in JSDOMParser and Readability.js
This change ups the required node version to 7.0 because it relies on the builtin url module.

We now pass a url when constructing a jsdom document or JSDOMParser document.
Because this is an API change, I'm increasing the package version.

Ultimately, I would like to remove the  argument from the readability constructor. It should
use the documentURI from the document it is passed.
2018-02-28 11:29:29 +00:00
Cameron McCormack
d88c9afc63 Use a hard coded classesToPreserve in tests. 2017-11-21 10:04:59 +00:00
Björgvin Ragnarsson
c3ff1a2d2c remove dead code 2017-11-02 23:15:13 +00:00
Gijs Kruitbosch
6f0bd81dfa Provide more useful output when attributes mismatch, r=me,test-only 2017-08-09 20:05:47 +01:00
Gijs Kruitbosch
66c013c4fb Make it easier to find where errors are coming from based on the error message 2017-01-30 15:19:37 +01:00
Gijs Kruitbosch
0ab4ac8556 Fix test failures caused by timeout still being too low 2016-12-14 11:41:38 +00:00
Evan Tseng
e84c0c3f07 Bug 1285543 - Only use "og:title" or "twitter:title" if _getArticleTitle does not return a valid title, r=Gijs 2016-12-14 11:34:15 +00:00
Evan Tseng
af0aa5c59f Bug 1173548 - Find out text direction from ancestors of final candidate, r=Gijs 2016-11-25 10:24:41 +00:00
Evan Tseng
4fa0d1b207 Bug 1177619 - Score div nodes which have br nodes. r=Gijs 2016-11-01 10:25:57 +00:00
Gijs
1a12befa41 Fix code style, tighten up eslint rules (#301) 2016-07-19 21:44:27 +01:00
Gijs Kruitbosch
a4d1e9ca12 Fix oversight in comment removal code exposed by better/newer jsdom implementation 2016-03-10 15:09:36 +00:00
Gijs Kruitbosch
dffa760c04 Fix issue #267 by ignoring hash URIs when making URIs absolute 2016-03-07 10:32:09 +00:00
Gijs Kruitbosch
2e1cb3f467 Fix issue #251 by making JSDOMParser expect XML and stop making excuses for 'self-closed' things, when all that does is cause trouble 2016-01-22 19:57:45 +00:00
Nicolas Perriault
9dbc009376 Fixes #113 - Recursive node ancestor scoring. 2015-04-29 22:51:45 +02:00
Nicolas Perriault
de89036cd5 Fixes #130 - Using js-beautify for HTML formatting. 2015-04-21 10:30:48 +02:00
Nicolas Perriault
12c6a11f67 Fixes #163 - Avoid including footer tag contents. 2015-04-17 17:33:04 +02:00
Nicolas Perriault
4424b0bad7 Refs #128 - Add support for options to Readability constructor. r=@gijsk 2015-04-09 11:56:58 +02:00
Gijs Kruitbosch
c53ca31907 Fixed test result output being sent at once 2015-04-08 15:24:34 +01:00
Gijs Kruitbosch
225adef137 Turn off JS when using JSDOM in tests. 2015-04-03 22:42:29 +01:00
Gijs Kruitbosch
b1f6c62b25 Fix tests for readability to also work with jsdom
For instance, jsdom's more spec-compliant parsing causes issues with auto-closing elements (lifehacker article) and with not having self-closing <img> and <br> tags. The former was fixed by removing offending markup, the latter by adjusting JSDOMParser to be more sane, and the expected outputs to cope with this.

Finally, JSDOMParser automatically drops comments. The test code needed to manually do this in the jsdom case.
2015-04-03 22:41:55 +01:00
Nicolas Perriault
3b636b59f0 Added readerable value to test pages metadata. 2015-04-03 15:14:49 +02:00
Margaret Leibovic
6b7834f798 add test for isProbablyReaderable 2015-04-02 17:40:06 -04:00
Nicolas Perriault
1e14d47bb7 Added benchmarks. 2015-04-01 21:58:42 +02:00
Gijs
14b33b69db Merge pull request #65 from mozilla/support-embed-videos
Fixes #56 - Updated support for embedded Youtube & Vimeo videos.
2015-03-23 14:48:00 +00:00
Nicolas Perriault
ad52d8ee30 Fixes #53 - Fixed dot-slash relative URI resolution. 2015-03-23 12:54:46 +01:00
Nicolas Perriault
2d5f59f3eb Fixes #56 - Updated support for embedded Youtube & Vimeo videos. 2015-03-23 10:07:04 +01:00
Nicolas Perriault
cf3dce6cf2 Refs #58 - Stripped embed tags. 2015-03-22 17:52:23 +01:00
Gijs Kruitbosch
f9e770ad3b Write a bunch of tests for jsdomparser 2015-03-20 10:32:28 -07:00