mozilla / readability

A standalone version of the readability lib
Other
8.66k stars 591 forks source link

No reader mode offered for IETF draft spec page #145

Closed n1k0 closed 9 years ago

n1k0 commented 9 years ago

http://tools.ietf.org/html/draft-dejong-remotestorage-04

almet commented 9 years ago

It seems the issue is not with the readability.js implementation, but rather with the reader mode detection. I don't know where this code leaves though, and any pointers would be appreciated (because obviously, this is behaving in a wrong way).

leibovic commented 9 years ago

This sounds similar to this bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1154295

gijsk commented 9 years ago

Yeah... not sure what to do about this. :-\

msujaws commented 9 years ago

We can detect if it is a .txt document pretty easily. We will need the parser though to break up the blocks of text and create paragraphs out of them. Could we just look for consecutive line-breaks (more than 1)?

msujaws commented 9 years ago

In privileged JS, you can check to see if document.mozSyntheticDocument is true. If so, then check that the body only has one child (pre) and that the pre has no children.

I don't think we should care about the length of these documents. Checking pre.textContent.length is gonna be a very long string for most .txt documents.

gijsk commented 9 years ago

This isn't a .txt document though...

n1k0 commented 9 years ago

Fixed by #188.