Skip to content

Commit

Permalink
Feat speciesSheet: use markdown for TaxHub attribute
Browse files Browse the repository at this point in the history
Close #413
  • Loading branch information
jpm-cbna committed Dec 7, 2023
1 parent 5a918b1 commit 7725bfa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
8 changes: 5 additions & 3 deletions atlas/modeles/repositories/vmCorTaxonAttribut.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding:utf-8 -*-

from sqlalchemy.sql import text
import markdown


def getAttributesTaxon(connection, cd_ref, attrDesc, attrComment, attrMilieu, attrChoro):
Expand All @@ -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
1 change: 1 addition & 0 deletions requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ geojson
gunicorn
itsdangerous
Jinja2
markdown
MarkupSafe
marshmallow
psycopg2
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7725bfa

Please sign in to comment.