Fix double-parentheses

This commit is contained in:
jgoel 2020-08-09 09:14:14 -04:00
parent 51b132e742
commit 7405ba57f9

View file

@ -1,4 +1,12 @@
from parsers.recipe import WpJsonRecipe
class Minimalistbaker(WpJsonRecipe):
pass
def get_json_recipe(self, d):
recipe = super().get_json_recipe(d)
# thewoksoflife.com for some reason has double parentheses in its
# ingredients. Remove them.
recipe['ingredients'] = [
ingredient.replace('((', '(').replace('))', ')').replace('//', '/')
for ingredient in recipe.get('ingredients', [])]
return recipe