remplaced markdown2 by markdown module

This commit is contained in:
2022-12-10 18:12:01 +01:00
parent 1436dde205
commit 0ad2cba192
7 changed files with 21 additions and 22 deletions

View File

@@ -1,6 +1,6 @@
from pyramid.view import view_config
from pyramid.httpexceptions import HTTPNotFound, HTTPFound
from markdown2 import Markdown
import markdown
import datetime #<- will be used to set default dates on models
from ..models.blog_record import BlogRecord
@@ -20,9 +20,8 @@ def blog(request):
# insèrer le path de static/img
body = entry.body.replace('static/', "%s/static/" % request.application_url)
# convertir mardown en HTML
markdowner = Markdown()
body_html = markdowner.convert(body)
# convertir de markdown en HTML
body_html = markdown.markdown(body, extensions=['footnotes'])
return {
'page_title': entry.title,
@@ -172,8 +171,7 @@ def topic(request):
# get the topic record
topic_record = BlogRecordService.get_topic_byTopic(request, topic)
# convertir champ topic_quote en HTML
markdowner = Markdown()
topic_quote = markdowner.convert(topic_record.topic_quote)
topic_quote = markdown.markdown(topic_record.topic_quote)
# insèrer le path de static/img
topic_quote = topic_quote.replace('static/', "%s/static/" % request.application_url)