mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-05 13:35:23 +02:00
fix: removed HTML tags when copying recipe ingredients (#2533)
This commit is contained in:
parent
408ca88cb2
commit
0a00a6ea0d
3 changed files with 17 additions and 6 deletions
|
@ -31,7 +31,16 @@ describe(parseIngredientText.name, () => {
|
|||
test("ingredient text with fraction", () => {
|
||||
const ingredient = createRecipeIngredient({ quantity: 1.5, unit: { fraction: true, id: "1", name: "cup" } });
|
||||
|
||||
expect(parseIngredientText(ingredient, false)).contain("1 <sup>1</sup>").and.to.contain("<sub>2</sub>");
|
||||
expect(parseIngredientText(ingredient, false, 1, true)).contain("1 <sup>1</sup>").and.to.contain("<sub>2</sub>");
|
||||
});
|
||||
|
||||
test("ingredient text with fraction no formatting", () => {
|
||||
const ingredient = createRecipeIngredient({ quantity: 1.5, unit: { fraction: true, id: "1", name: "cup" } });
|
||||
const result = parseIngredientText(ingredient, false, 1, false);
|
||||
|
||||
expect(result).not.contain("<");
|
||||
expect(result).not.contain(">");
|
||||
expect(result).contain("1 1/2");
|
||||
});
|
||||
|
||||
test("sanitizes html", () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue