proper replace images
This commit is contained in:
parent
0835bec611
commit
94b593da93
@ -44,10 +44,6 @@ spip_to_markdown = (
|
|||||||
compile(r"\[ *(.*?) *-> *(.*?) *\]", S | I),
|
compile(r"\[ *(.*?) *-> *(.*?) *\]", S | I),
|
||||||
r"[\1](\2)",
|
r"[\1](\2)",
|
||||||
),
|
),
|
||||||
( # image
|
|
||||||
compile(r"<(?:img|image)(.*?)(\|.*?)*>", S | I),
|
|
||||||
r"![image](\1)",
|
|
||||||
),
|
|
||||||
( # document anchor
|
( # document anchor
|
||||||
compile(r"<(?:doc|emb)(.*?)(\|.*?)*>", S | I),
|
compile(r"<(?:doc|emb)(.*?)(\|.*?)*>", S | I),
|
||||||
r"[document](\1)",
|
r"[document](\1)",
|
||||||
@ -114,6 +110,9 @@ spip_to_markdown = (
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
## Match SPIP images
|
||||||
|
spip_image = compile(r"<(?:img|image)(.*?)(\|.*?)*>", S | I)
|
||||||
|
|
||||||
spip_to_text = (
|
spip_to_text = (
|
||||||
( # strong
|
( # strong
|
||||||
compile(r"\{\{ *(.*?) *\}\}", S | I),
|
compile(r"\{\{ *(.*?) *\}\}", S | I),
|
||||||
@ -159,8 +158,8 @@ spip_to_text = (
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Broken ISO encoding to proper UTF-8
|
||||||
iso_to_utf = (
|
iso_to_utf = (
|
||||||
# Broken encoding
|
|
||||||
( # Fix UTF-8 appostrophe that was interpreted as ISO 8859-1
|
( # Fix UTF-8 appostrophe that was interpreted as ISO 8859-1
|
||||||
"’",
|
"’",
|
||||||
r"’",
|
r"’",
|
||||||
@ -272,7 +271,7 @@ iso_to_utf = (
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
## WARNING unknown broken encoding
|
# WARNING unknown broken encoding
|
||||||
unknown_iso = (
|
unknown_iso = (
|
||||||
r"
", # unknown 

|
r"
", # unknown 

|
||||||
r"∆", # unknown â^†
|
r"∆", # unknown â^†
|
||||||
|
Loading…
Reference in New Issue
Block a user