fix(backend): rendering issue
This commit is contained in:
@@ -46,7 +46,10 @@ export const unitsOfMeasure = {
|
||||
export function parseIngredients(
|
||||
text: string,
|
||||
): (Ingredient | IngredientGroup)[] {
|
||||
const cleanText = removeMarkdownFormatting(text);
|
||||
const cleanText = removeMarkdownFormatting(text)
|
||||
.split("\n")
|
||||
.map((line) => line.trim().replace(/^-/, ""))
|
||||
.join("\n");
|
||||
|
||||
const ingredients = parseIngredient(cleanText, {
|
||||
normalizeUOM: true,
|
||||
|
@@ -160,6 +160,11 @@ export function renderRecipe(recipe: Recipe) {
|
||||
item.unit?.trim() || ""
|
||||
}** ${item.name}`;
|
||||
}
|
||||
|
||||
if (item.quantity) {
|
||||
return `- **${item.quantity}** ${item.name}`;
|
||||
}
|
||||
|
||||
return `- ${item.name}`;
|
||||
})
|
||||
.join("\n");
|
||||
|
Reference in New Issue
Block a user