From e73398b3b246ef234dfd4fecaf05738274b2922c Mon Sep 17 00:00:00 2001 From: Tykayn Date: Fri, 28 Feb 2025 19:25:09 +0100 Subject: [PATCH] =?UTF-8?q?up=20conversion=20de=20liens=20web=20en=20gemin?= =?UTF-8?q?i,=20=C3=A9chappement=20markdown?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/utils.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/utils/utils.py b/utils/utils.py index 215a83a3..6301d88e 100644 --- a/utils/utils.py +++ b/utils/utils.py @@ -453,6 +453,13 @@ def org_to_gmi(org_text: str) -> str: # Conversion du texte Org en GMI via Pandoc try: converted_text = pypandoc.convert_text(org_content, 'markdown', format='org') + # Remplacer les apostrophes échappées + converted_text = converted_text.replace('\\\'', '\'') + + # Convertir les liens HTML en liens Gemini + # Ajouter des retours à la ligne avant et après les liens web + converted_text = re.sub(r'<(https?://[^>]+)>', r'\n=> \1\n', converted_text) + output = f""" -------------------