Commit 7324f3e9 authored by Matthieu Boileau's avatar Matthieu Boileau
Browse files

Handle italic and bold tags with space

parent 9ee76d56
......@@ -53,20 +53,35 @@ def header(s):
def italic(s):
"""
SPIP: {..}
SPIP: {...}
md: *...*
"""
return re.sub(r"(^|[^{]){([^}]+)}([^}]|$)", r"\1*\2*\3", s)
def italic_spaces(s):
"""
SPIP: { ... }
md: *...*
"""
return re.sub(r"(^|[^{]){ ([^}]+) }([^}]|$)", r"\1*\2*\3", s)
def bold(s):
"""
SPIP: {{..}}
SPIP: {{...}}
md: **...**
"""
return re.sub(r"(^|[^{]){{([^}]+)}}([^}]|$)", r"\1**\2**\3", s)
def bold_spaces(s):
"""
SPIP: {{ ... }}
md: **...**
"""
return re.sub(r"(^|[^{]){{ ([^}]+) }}([^}]|$)", r"\1**\2**\3", s)
def html_link(s, website):
"""Replace html href by the right Pelican (relative) URL"""
......@@ -249,8 +264,10 @@ def spip_to_markdown(s, website):
"""Convert string from Spip format to Pelican markdown format"""
s = html_link(s, website)
s = html_img(s, website)
s = bold_spaces(s)
s = italic(s)
s = bold(s)
s = italic_spaces(s)
s = ordered_list(s)
s = unordered_list(s)
s = header(s)
......
......@@ -23852,7 +23852,7 @@
<center>
<A HREF="#firedrake">Solving PDEs with Firedrake</A>
<font color=#6699CC><html>&nbsp;&nbsp;&nbsp;&nbsp;</html>{ {{Lawrence Mitchell}}
<font color=#6699CC><html>&nbsp;&nbsp;&nbsp;&nbsp;</html>{{Lawrence Mitchell}}
Departments of Computing and Mathematics, Imperial College London }</font>
......@@ -24473,8 +24473,7 @@
{{{Programme}}}
{{{<font color=#6699CC>{{Lundi 29 mai 2017}}</font>
}}}
{{{<font color=#6699CC>{{Lundi 29 mai 2017}}</font>}}}
- { {{9:30-10:00 :}} } Accueil
- { {{10:00-11:30 :}} } Introduction à Git, Alexandre Ancel (IHU Strasbourg), [Support -> doc489]
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment