feat: Add optional note field to ingredient parsing and update related components

This commit is contained in:
Nils-Johan Gynther
2026-04-12 10:30:05 +02:00
parent 03727ee3c5
commit 9ca7fcce96
7 changed files with 158 additions and 34 deletions
@@ -46,7 +46,7 @@ export class IcaRecipeParser extends RecipeParser {
const name = recipe.name || '';
// Extrahera ingredienser
const ingredients: Array<{ quantity: number; unit: string; name: string }> = [];
const ingredients: Array<{ quantity: number; unit: string; name: string; note?: string }> = [];
if (recipe.recipeIngredient && Array.isArray(recipe.recipeIngredient)) {
for (const ing of recipe.recipeIngredient) {
const parsed = this.parseIngredientLine(ing);
@@ -96,7 +96,7 @@ export class IcaRecipeParser extends RecipeParser {
}
}
const ingredients: Array<{ quantity: number; unit: string; name: string }> = [];
const ingredients: Array<{ quantity: number; unit: string; name: string; note?: string }> = [];
const ingredientRegex =
/<li[^>]*class="[^"]*ingredient[^"]*"[^>]*>([^<]+)<\/li>/gi;
let match;