tmp: настройки типографа (15) борьба с CodeMirror 6

This commit is contained in:
2026-01-05 21:25:02 +03:00
parent d4a9345463
commit 0a4fcb44be
2 changed files with 52 additions and 11 deletions

View File

@@ -46,10 +46,10 @@ def process_text(request):
)
# 4. Читаем Sanitizer
sanitizer_enabled = request.POST.get(key='sanitizer_enabled', default='')
sanitizer_option = request.POST.get(key='sanitizer', default='etp')
if sanitizer_enabled and sanitizer_option not in ['etp', 'html']:
sanitizer_option = 'etp'
sanitizer_enabled = request.POST.get(key='sanitizer_enabled') == 'on'
sanitizer_option = None
if sanitizer_enabled:
sanitizer_option = request.POST.get(key='sanitizer', default='etp')
# 5. Читаем Hanging Punctuation
hanging_enabled = request.POST.get(key='hanging_enabled') == 'on'
@@ -70,6 +70,10 @@ def process_text(request):
'mode': request.POST.get(key='mode', default='mixed'),
'sanitizer': sanitizer_option
}
# --- ДИАГНОСТИКА ---
print("Typographer options:", options)
# -------------------
# Создаем экземпляр типографа
typo = Typographer(**options)