Tutor/answers: bare subscripts (S_n, a_1) become Unicode; migration 0022 re-cleans DB text

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-12 12:18:46 +03:30
parent e662914efc
commit b075b93f2a
5 changed files with 31 additions and 4 deletions

View File

@@ -255,7 +255,9 @@ def _to_plain(text: str) -> str:
text = _strip_markdown(text)
text = re.sub(r'[ \t]+\n', '\n', text)
text = re.sub(r'\n{3,}', '\n\n', text)
return text.strip()
# S_n، a_1، x^2 و توانِ پیچیده که بالا رد شد: همان تبدیلِ seed/دیتابیس (یک رفتار در همه‌جا).
from content.plain_math import convert as _plain
return _plain(text).strip()
class StreamSanitizer: