Remove redundant step numbers from recipe instructions in UI and database
This commit is contained in:
@@ -130,6 +130,14 @@ async def auth_middleware(request: Request, call_next):
|
||||
app.mount("/static", StaticFiles(directory=STATIC_DIR), name="static")
|
||||
templates = Jinja2Templates(directory=TEMPLATES_DIR)
|
||||
|
||||
def strip_step_number_filter(text: str) -> str:
|
||||
if not text:
|
||||
return ""
|
||||
import re
|
||||
return re.sub(r'^(?:Schritt\s*\d+[:.]?|\d+[\.\)\:])\s*', '', str(text).strip(), flags=re.IGNORECASE)
|
||||
|
||||
templates.env.filters["strip_step_number"] = strip_step_number_filter
|
||||
|
||||
# Mapping Kochbuch-Kapitel -> Zufallsgenerator-Kategorien
|
||||
CHAPTER_TO_DISH_CAT = {
|
||||
"Suppen & Eintöpfe": "Suppen",
|
||||
|
||||
Reference in New Issue
Block a user