RecipeFilter
RecipeFilter copied to clipboard
Add selector for smittenkitchen, Add support for recipes that are more than one node
i haven't tested the other websites to see if the else path causes any breaking changes. i'm not entirely sure which sites the other selectors are for, but if there's a list somewhere, i'll gladly run through a few test pages.
The if ($r.length === 1) was important long ago and I can't recall exactly why, but if multiple selectors match, it's an indication that it shouldn't run on the site. I think maybe it was trying to run on search results and blog homepages with multiple recipes.
Let's break the PR up:
- (Looks good to go) cleaning up with
const controls, nice! - (Looks good to go) smittenkitchen selector (or does it need to match multiple?)
- (Needs a separate PR to vet/test) handling when
$r.length>1
ok, i split out const controls to its own pr, https://github.com/sean-public/RecipeFilter/pull/12. yeah, the smittenkitchen recipe is $r.length > 1. the selector for it is made a little easier because they have a noprint class on the essay part of their recipe, but you still have to gather up more than one node.
Waited so long that they changed the site and now it works without any of the multi-matching changes in this PR. Closing because the other great stuff was already broken out and merged in!