intermediate commit

This commit is contained in:
Freestyle-Play
2025-10-08 16:07:30 +03:00
parent bac78a9cee
commit 8ba0f89f89
5 changed files with 167 additions and 12 deletions

19
test.py Normal file
View File

@@ -0,0 +1,19 @@
from handlers.convertMdToPdf import ConvertMdToPdf
import re
# Создаем экземпляр класса
converter = ConvertMdToPdf()
# Тестовые примеры дробей
test_cases = [
r"$\frac{1}{2}$", # простая дробь
r"$\dfrac{3}{4}$", # дробь с displaystyle
r"$\frac{a}{b} + \frac{c}{d}$", # сложение дробей
r"$$\frac{x^2}{y^3}$$", # блочная дробь
r"$\frac{\partial f}{\partial x}$" # частная производная
]
for latex in test_cases:
result = converter.replace_math(re.search(r'\$\$(.*?)\$\$|\$(.*?)\$', latex))
print(f"Input: {latex}")
print(f"Output: {result}")
print("---")