mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-02 20:15:24 +02:00
parent
3125730702
commit
4d3346b727
3 changed files with 376 additions and 15 deletions
|
@ -1,5 +1,4 @@
|
|||
// @ts-ignore DOMPurify has no types
|
||||
import DOMPurify from "dompurify";
|
||||
import DOMPurify from "isomorphic-dompurify";
|
||||
import { useFraction } from "./use-fraction";
|
||||
import { RecipeIngredient } from "~/types/api-types/recipe";
|
||||
const { frac } = useFraction();
|
||||
|
@ -8,7 +7,7 @@ function sanitizeIngredientHTML(rawHtml: string) {
|
|||
return DOMPurify.sanitize(rawHtml, {
|
||||
"USE_PROFILES": {html: true},
|
||||
"ALLOWED_TAGS": ["b", "q", "i", "strong", "sup"]
|
||||
}) as string
|
||||
});
|
||||
}
|
||||
|
||||
export function parseIngredientText(ingredient: RecipeIngredient, disableAmount: boolean, scale = 1): string {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue