diff --git a/backend/guide.py b/backend/guide.py index b618ec1..05c2fc2 100644 --- a/backend/guide.py +++ b/backend/guide.py @@ -169,6 +169,11 @@ def _mathe_auftraege(text: str, wo: str) -> list[str]: if re.search(r"\\n(?![a-zA-Z])", text): # \neq etc. bleiben unberührt auftraege.append(f"{wo}: literales „\\n“ im Text — durch echten" f" Zeilenumbruch bzw. Leerzeile ersetzen.") + lange = [m for m in re.findall(r"\$([^$\n]+?)\$", text) if len(m) > 60] + if lange: # Inline-Formeln brechen nie um — auf schmalen Screens Überlauf + auftraege.append(f"{wo}: {len(lange)} überlange Inline-Formel(n)" + f" (>60 Zeichen, z. B. „{lange[0][:40]}…“): abgesetzt" + f" als $$…$$ setzen.") formeln = ([{"tex": m, "display": True} for m in re.findall(r"\$\$([\s\S]+?)\$\$", text)] + [{"tex": m, "display": False} for m in re.findall(r"\$([^$\n]+?)\$", text)]) for f in _katex_fehler(formeln): diff --git a/frontend/src/App.vue b/frontend/src/App.vue index b0a331f..53c51ca 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -14,7 +14,10 @@ const neuName = ref('') const neuArt = ref('thema') const fehler = ref('') const theme = ref(localStorage.getItem('theme') || 'auto') -const navAuf = ref(localStorage.getItem('navAuf') !== '0') +// mobil (≤768px) startet die Navigation eingeklappt, sofern nie manuell gesetzt +const navAuf = ref(localStorage.getItem('navAuf') !== null + ? localStorage.getItem('navAuf') !== '0' + : window.innerWidth > 768) function navToggle() { navAuf.value = !navAuf.value @@ -176,9 +179,11 @@ function runBadge(run) { +