diff --git a/klausur-service/backend/grid_editor_helpers.py b/klausur-service/backend/grid_editor_helpers.py index 8100dc2..ba1ae36 100644 --- a/klausur-service/backend/grid_editor_helpers.py +++ b/klausur-service/backend/grid_editor_helpers.py @@ -1053,6 +1053,16 @@ def _detect_heading_rows_by_single_cell( text = (cell.get("text") or "").strip() if not text or text.startswith("["): continue + # Continuation lines start with "(" — e.g. "(usw.)", "(TV-Serie)" + if text.startswith("("): + continue + # Single cell NOT in the first content column is likely a + # continuation/overflow line, not a heading. Real headings + # ("Theme 1", "Unit 3: ...") appear in the first or second + # content column. + first_content_col = col_indices[0] if col_indices else 0 + if cell.get("col_index", 0) > first_content_col + 1: + continue # Skip garbled IPA without brackets (e.g. "ska:f – ska:vz") # but NOT text with real IPA symbols (e.g. "Theme [θˈiːm]") _REAL_IPA_CHARS = set("ˈˌəɪɛɒʊʌæɑɔʃʒθðŋ")