mod: настройки типографа (06) режимы layout

This commit is contained in:
2026-01-02 20:11:12 +03:00
parent 75ef076e14
commit 8636b7854c
2 changed files with 33 additions and 10 deletions

View File

@@ -18,11 +18,20 @@ def process_text(request):
layout_option = False # По умолчанию выключен
if layout_enabled:
# Обработка единиц измерения
process_units = request.POST.get('layout_units') == 'on'
if process_units:
# Если включено, проверяем кастомные единицы
custom_units = request.POST.get('layout_units_custom', '').strip()
if custom_units:
# Если есть кастомные, передаем их списком (библиотека сама объединит с дефолтными)
process_units = custom_units.split()
# Если включен, создаем процессор с тонкими настройками
layout_option = LayoutProcessor(
langs=langs,
process_initials_and_acronyms=request.POST.get('layout_initials') == 'on',
process_units=request.POST.get('layout_units') == 'on'
process_units=process_units
)
# 3. Читаем Sanitizer