Skip to content
Snippets Groups Projects
Commit 73b9c55a authored by David Rouquet's avatar David Rouquet
Browse files

fix infoboxes by putting html instead of md

parent 1d5bc166
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,7 @@ from rdflib import OWL, RDF, Graph, Literal ...@@ -2,6 +2,7 @@ from rdflib import OWL, RDF, Graph, Literal
from lxml import html from lxml import html
#import pandoc #import pandoc
from markitdown import MarkItDown from markitdown import MarkItDown
from markdown import markdown
import tempfile import tempfile
import re import re
from glob import glob from glob import glob
...@@ -48,6 +49,7 @@ def markFileDown(filepath): ...@@ -48,6 +49,7 @@ def markFileDown(filepath):
def prepareHTMLforMD(str): def prepareHTMLforMD(str):
str = str.replace("\r"," ")
# Identify audio content and add markups to identify them in the MD # Identify audio content and add markups to identify them in the MD
regexAV = re.compile(r".*?PF_clipAV\('.*?', '(.*?).swf',.*") regexAV = re.compile(r".*?PF_clipAV\('.*?', '(.*?).swf',.*")
str = regexAV.sub(r"@AUDIOSTART\1@AUDIOEND", str) str = regexAV.sub(r"@AUDIOSTART\1@AUDIOEND", str)
...@@ -106,8 +108,8 @@ def postEditMD(str1): ...@@ -106,8 +108,8 @@ def postEditMD(str1):
try: try:
file = open(filepath, 'r', encoding='utf-8') file = open(filepath, 'r', encoding='utf-8')
file.close() file.close()
md = markFileDown(filepath) simpleHtml = markdown(markFileDown(filepath))
commentaireInfo_md = '<div class="commentaireInfo" commentaireId="'+str(i)+'">'+md+'</div>' commentaireInfo_md = '<div class="commentaireInfo" commentaireId="'+str(i)+'">'+simpleHtml+'</div>'
str1 = str1.replace(match,str(i)) str1 = str1.replace(match,str(i))
except FileNotFoundError: except FileNotFoundError:
pass pass
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment