fixes#118. as far as we can tell, this is probably the root cause of many of these bugs filed against webmention.io over the last couple years, https://github.com/aaronpk/webmention.io/issues , eg #188, #187, #175, #173, etc.
@aaronpk [said](https://chat.indieweb.org/dev/2023-08-07#t1691382116891200):
> That was apparently added 8 years ago
> i vaguely remember some old issue with appspot URLs that I had to work around
that appspot URL issue was probably that it required SNI for SSL, which was less supported then, and much more widely supported now, so I'm pretty sure this change is ok.
cc @osa_k
* Default options are applied to calls to parse(), rels(), feeds() and process()
* Default options are overridden by options passed to the respective function call on a
property-by-property basis
* Documented in README with example
* Added basic test (only for parse() behaviour)
* Also fixed a bug causing an error processing h-cards with no URL property
* Added isImgAlt static method to Formats\Mf2
* Used it in collectArrayURLValues and getPlaintext to handle cases where
img+alt structures are encountered
Additionally disabled reporting of deprecation warnings while testing for
a cleaner output. All tests are passing.
`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.
* looks through the full mf2 tree for step 7 of authorship https://github.com/indieweb/authorship/issues/2
* if no author h-card is found, falls back to returning the author URL without other data instead of missing author
closes#95
if the document contains a link to the target, but that link is not in the parsed result, don't return an error, but also don't return the parsed document
closes#150
To make it possible to consume feeds of pre-rendered Microformats2 JSON
data, we need to be able to discover that it is a Microformats2 JSON
file using the known MIME types documented in
http://microformats.org/wiki/microformats2-mime-type
The previous check removed a h-card, but this one still takes the first of the original array. Which means, in the case of `h-card+h-entry`, the h-card get’s removed, but then the if triggers and the `h-card` is selected.
* a single h-entry and h-card, where the h-entry has no URL, will result in a permalink page with that h-entry
* multiple h-entrys followed by an h-card is a feed