mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-06 11:50:49 +08:00
LLMs often emit single \\n characters between logical paragraphs in question / answer / explanation fields. In markdown this renders as a soft-break, causing the front-end to collapse everything into one dense block. Add _normalize_markdown_paragraphs() to Generator so that isolated single newlines are turned into \\n\\n paragraph breaks before the payload is returned. Structural markers (lists, code fences, tables, headings) are preserved to avoid breaking intentional formatting. Fixes quiz questions appearing without paragraph spacing in the web UI.