Spaces:
Running
Running
[email protected]
commited on
Commit
·
9bc1cf0
1
Parent(s):
d53834c
refactor: Remove unused markdown_to_reportlab function from document.py
Browse files- utils/document.py +0 -11
utils/document.py
CHANGED
@@ -168,16 +168,6 @@ def markdown_to_html(md_text):
|
|
168 |
|
169 |
return generate_pdf_from_html(html)
|
170 |
|
171 |
-
# Fonction pour convertir le Markdown en texte enrichi compatible ReportLab
|
172 |
-
def markdown_to_reportlab(text):
|
173 |
-
# text = text.replace("**", "<b>").replace("__", "<b>") # Gras
|
174 |
-
# text = text.replace("*", "<i>").replace("_", "<i>") # Italique
|
175 |
-
text = text.replace("\n", "<br/>") # Italique
|
176 |
-
# text = re.sub(r"\n- (.+)", r"\n• \1", text) # Listes à puces
|
177 |
-
# text = re.sub(r"^# (.+)", r"<b><font size='16'>\1</font></b>", text, flags=re.MULTILINE) # Titre H1
|
178 |
-
# text = re.sub(r"^## (.+)", r"<b><font size='14'>\1</font></b>", text, flags=re.MULTILINE) # Titre H2
|
179 |
-
# text = re.sub(r"^### (.+)", r"<b><font size='12'>\1</font></b>", text, flags=re.MULTILINE) # Titre H3
|
180 |
-
return text
|
181 |
|
182 |
def generate_pdf(chapter_data: list, displayPromptSystem = True):
|
183 |
buffer = BytesIO()
|
@@ -222,7 +212,6 @@ def generate_pdf(chapter_data: list, displayPromptSystem = True):
|
|
222 |
|
223 |
content = msg.content
|
224 |
content = markdown_to_html(content)
|
225 |
-
content = markdown_to_reportlab(content)
|
226 |
|
227 |
elements.append(Paragraph(content, style_message))
|
228 |
elements.append(Spacer(1, 10))
|
|
|
168 |
|
169 |
return generate_pdf_from_html(html)
|
170 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
|
172 |
def generate_pdf(chapter_data: list, displayPromptSystem = True):
|
173 |
buffer = BytesIO()
|
|
|
212 |
|
213 |
content = msg.content
|
214 |
content = markdown_to_html(content)
|
|
|
215 |
|
216 |
elements.append(Paragraph(content, style_message))
|
217 |
elements.append(Spacer(1, 10))
|