From da6eb3dd6a8d3f0a8c1a6722121f21f08c2829b9 Mon Sep 17 00:00:00 2001 From: Jean-Pascal MILCENT Date: Sun, 24 Apr 2022 17:52:14 +0200 Subject: [PATCH] Feat speciesSheet: use markdown for TaxHub attribute --- atlas/modeles/repositories/vmCorTaxonAttribut.py | 8 +++++--- requirements.in | 1 + requirements.txt | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/atlas/modeles/repositories/vmCorTaxonAttribut.py b/atlas/modeles/repositories/vmCorTaxonAttribut.py index b737b389..f275ffac 100644 --- a/atlas/modeles/repositories/vmCorTaxonAttribut.py +++ b/atlas/modeles/repositories/vmCorTaxonAttribut.py @@ -1,6 +1,7 @@ # -*- coding:utf-8 -*- from sqlalchemy.sql import text +import markdown def getAttributesTaxon( @@ -28,12 +29,13 @@ def getAttributesTaxon( 'chorologie': None } for r in req: + html_value = markdown.markdown(r.valeur_attribut) if r.id_attribut == attrDesc: - descTaxon['description'] = r.valeur_attribut + descTaxon['description'] = html_value elif r.id_attribut == attrComment: - descTaxon['commentaire'] = r.valeur_attribut + descTaxon['commentaire'] = html_value elif r.id_attribut == attrMilieu: descTaxon['milieu'] = r.valeur_attribut.replace("&", " | ") elif r.id_attribut == attrChoro: - descTaxon['chorologie'] = r.valeur_attribut + descTaxon['chorologie'] = html_value return descTaxon diff --git a/requirements.in b/requirements.in index 67bf78a8..d8892023 100644 --- a/requirements.in +++ b/requirements.in @@ -10,6 +10,7 @@ geojson gunicorn itsdangerous < 2.0 Jinja2 < 3.0 +markdown MarkupSafe marshmallow python-dotenv diff --git a/requirements.txt b/requirements.txt index 3954f2ae..bb4acf4d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,6 +14,7 @@ gunicorn==20.1.0 importlib-metadata==4.8.2 itsdangerous==1.1.0 Jinja2==2.11.3 +markdown==3.3.6 MarkupSafe==2.0.1 marshmallow==3.14.1 packaging==21.3