Skip to content

Commit

Permalink
remove redundant comments
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-genson committed Apr 10, 2024
1 parent ed8d642 commit e992625
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions mealie/routes/spa/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,11 @@ def inject_recipe_json(contents: str, schema: dict) -> str:
try:
data = json.loads(script_tag.string)
if data.get("@type") == "Recipe":
# If the script tag exists and its @type is 'Recipe', replace its contents
script_tag.string = schema_as_json
break
except json.JSONDecodeError:
continue
else:
# If no script tag with @type 'Recipe' exists, create a new one and add it to the head
schema_as_html_tag = soup.new_tag("script", type="application/ld+json")
schema_as_html_tag.string = schema_as_json
soup.head.append(schema_as_html_tag)
Expand Down

0 comments on commit e992625

Please sign in to comment.