diff --git a/atlas/modeles/repositories/vmCorTaxonAttribut.py b/atlas/modeles/repositories/vmCorTaxonAttribut.py index f5ef3234..c1cbad6c 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(connection, cd_ref, attrDesc, attrComment, attrMilieu, attrChoro): @@ -21,12 +22,13 @@ def getAttributesTaxon(connection, cd_ref, attrDesc, attrComment, attrMilieu, at descTaxon = {"description": None, "commentaire": None, "milieu": None, "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 12b58b5f..7c935cde 100644 --- a/requirements.in +++ b/requirements.in @@ -11,6 +11,7 @@ geojson gunicorn itsdangerous Jinja2 +markdown MarkupSafe marshmallow psycopg2 diff --git a/requirements.txt b/requirements.txt index bcf9dca3..a7430c64 100644 --- a/requirements.txt +++ b/requirements.txt @@ -49,6 +49,7 @@ jinja2==3.1.2 # -r requirements.in # flask # flask-babel +markdown==3.3.6 markupsafe==2.1.1 # via # -r requirements.in