From 94b593da93d93ac898021446b6fe992a833ef8dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guilhem=20Faur=C3=A9?= Date: Tue, 23 May 2023 10:33:04 +0200 Subject: [PATCH] proper replace images --- spip2md/converter.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/spip2md/converter.py b/spip2md/converter.py index 3f17b0d..83ed6a8 100644 --- a/spip2md/converter.py +++ b/spip2md/converter.py @@ -44,10 +44,6 @@ spip_to_markdown = ( compile(r"\[ *(.*?) *-> *(.*?) *\]", S | I), r"[\1](\2)", ), - ( # image - compile(r"<(?:img|image)(.*?)(\|.*?)*>", S | I), - r"![image](\1)", - ), ( # document anchor compile(r"<(?:doc|emb)(.*?)(\|.*?)*>", S | I), r"[document](\1)", @@ -114,6 +110,9 @@ spip_to_markdown = ( ), ) +## Match SPIP images +spip_image = compile(r"<(?:img|image)(.*?)(\|.*?)*>", S | I) + spip_to_text = ( ( # strong compile(r"\{\{ *(.*?) *\}\}", S | I), @@ -159,8 +158,8 @@ spip_to_text = ( ), ) +# Broken ISO encoding to proper UTF-8 iso_to_utf = ( - # Broken encoding ( # Fix UTF-8 appostrophe that was interpreted as ISO 8859-1 "’", r"’", @@ -272,7 +271,7 @@ iso_to_utf = ( ), ) -## WARNING unknown broken encoding +# WARNING unknown broken encoding unknown_iso = ( r"
", # unknown 
 r"∆", # unknown â^†