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)