mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-10-28 00:34:47 -04:00
fix clean_string error (#481)
This commit is contained in:
@@ -36,6 +36,9 @@ def clean(recipe_data: dict, url=None) -> dict:
|
|||||||
|
|
||||||
|
|
||||||
def clean_string(text: str) -> str:
|
def clean_string(text: str) -> str:
|
||||||
|
if text == "" or text is None:
|
||||||
|
return ""
|
||||||
|
else:
|
||||||
cleaned_text = html.unescape(text)
|
cleaned_text = html.unescape(text)
|
||||||
cleaned_text = re.sub("<[^<]+?>", "", cleaned_text)
|
cleaned_text = re.sub("<[^<]+?>", "", cleaned_text)
|
||||||
cleaned_text = re.sub(" +", " ", cleaned_text)
|
cleaned_text = re.sub(" +", " ", cleaned_text)
|
||||||
|
|||||||
Reference in New Issue
Block a user