Merge pull request #2763 from smilerz/fix_long_description
truncated long description
This commit is contained in:
commit
2cb010c8b4
@ -163,10 +163,9 @@ def get_from_scraper(scrape, request):
|
|||||||
if len(recipe_json['steps']) == 0:
|
if len(recipe_json['steps']) == 0:
|
||||||
recipe_json['steps'].append({'instruction': '', 'ingredients': [], })
|
recipe_json['steps'].append({'instruction': '', 'ingredients': [], })
|
||||||
|
|
||||||
|
recipe_json['description'] = recipe_json['description'][:512]
|
||||||
if len(recipe_json['description']) > 256: # split at 256 as long descriptions don't look good on recipe cards
|
if len(recipe_json['description']) > 256: # split at 256 as long descriptions don't look good on recipe cards
|
||||||
recipe_json['steps'][0]['instruction'] = f"*{recipe_json['description']}* \n\n" + recipe_json['steps'][0]['instruction']
|
recipe_json['steps'][0]['instruction'] = f"*{recipe_json['description']}* \n\n" + recipe_json['steps'][0]['instruction']
|
||||||
else:
|
|
||||||
recipe_json['description'] = recipe_json['description'][:512]
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
for x in scrape.ingredients():
|
for x in scrape.ingredients():
|
||||||
|
Loading…
Reference in New Issue
Block a user