From 0a4fcb44be167f3642ab3f5724259a74105f7c50 Mon Sep 17 00:00:00 2001 From: erjemin Date: Mon, 5 Jan 2026 21:25:02 +0300 Subject: [PATCH] =?UTF-8?q?tmp:=20=D0=BD=D0=B0=D1=81=D1=82=D1=80=D0=BE?= =?UTF-8?q?=D0=B9=D0=BA=D0=B8=20=D1=82=D0=B8=D0=BF=D0=BE=D0=B3=D1=80=D0=B0?= =?UTF-8?q?=D1=84=D0=B0=20(15)=20=D0=B1=D0=BE=D1=80=D1=8C=D0=B1=D0=B0=20?= =?UTF-8?q?=D1=81=20CodeMirror=206?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../typograph/templates/typograph/index.html | 51 ++++++++++++++++--- etpgrf_site/typograph/views.py | 12 +++-- 2 files changed, 52 insertions(+), 11 deletions(-) diff --git a/etpgrf_site/typograph/templates/typograph/index.html b/etpgrf_site/typograph/templates/typograph/index.html index 4ddf502..1bd8d21 100644 --- a/etpgrf_site/typograph/templates/typograph/index.html +++ b/etpgrf_site/typograph/templates/typograph/index.html @@ -144,19 +144,19 @@ {# ========== #}
- {# Группа «Санитайзер» #}
+ {# Группа "Санитайзер" #}
- +
- {# Настройки группы «Санитайзер» (видны, когда включено) #}
+ {# Настройки группы "Санитайзер" (видны, когда включено) #}
- {# Описание группы «Санитайзер» (видно, когда выключено) #}
- Текст будет обработан «как есть», без предва­рительной очистки от HTML-тегов или старой разметки. + {# Описание группы "Санитайзер" (видно, когда выключено) #}
+ Текст будет обработан «как есть», без предва­рительной очистки от HTML-тегов или старой разметки.
{# ========== #}
@@ -197,8 +197,45 @@

Результат

-
Здесь появится результат...
- +
+
+ + {% endblock %} diff --git a/etpgrf_site/typograph/views.py b/etpgrf_site/typograph/views.py index 75b13c0..8c51647 100644 --- a/etpgrf_site/typograph/views.py +++ b/etpgrf_site/typograph/views.py @@ -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)