Currently the findOutgoingLinks function naively looks only at the first mf2 object in items.
Here is the proposed solution:
Add a parameter to findOutgoingLinks that accepts the source URL of the page. For each item in the mf2 items, look for the item with a url property that matches the URL given. If none is found, defaulting to the first item is fine.
This works under the assumption that this function will only be used for sending webmentions for post permalinks, as this will not work for feed pages that contain multiple h-entrys (although it will work for a feed page that uses h-feed).
Currently the
findOutgoingLinksfunction naively looks only at the first mf2 object initems.Here is the proposed solution:
Add a parameter to
findOutgoingLinksthat accepts the source URL of the page. For each item in the mf2items, look for the item with aurlproperty that matches the URL given. If none is found, defaulting to the first item is fine.This works under the assumption that this function will only be used for sending webmentions for post permalinks, as this will not work for feed pages that contain multiple h-entrys (although it will work for a feed page that uses h-feed).