aaronpk / XRay

X-Ray returns structured data from any URL
https://xray.p3k.app
MIT License
90 stars 15 forks source link

fix: check prefix correctly #100

Closed hacdias closed 4 years ago

hacdias commented 4 years ago

strpos(string, sub) returns false if sub is not present in string. In this case, we want to check if sub is not a prefix of string. Hence, we just need to test if the returned position is simply different from 0.

About the test I changed: The test is checking for notes, but 'Bridge Fed' is, in fact, an article according to the post discovery algorithm. Also, I'm adding as note that the main difference between a note and an article is that the latter has a title, while the first doesn't.

aaronpk commented 4 years ago

I'm going to merge this but change the test back to require that one is an article