From: Paul Hänsch Date: Thu, 7 Mar 2024 17:37:25 +0000 (+0100) Subject: improved syntax translation X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=88f810ea1d815a37dc57d380e8c8ebaaa16b9466;p=shellwiki improved syntax translation --- diff --git a/moinimport.sh b/moinimport.sh index b747843..1815a83 100755 --- a/moinimport.sh +++ b/moinimport.sh @@ -26,11 +26,11 @@ reformat() { s;^----+$;\n&; - s;\{\{attachment:(.*)\|(.*)\|(.*)\}\};![\2](\1 "\3");g - s;\{\{attachment:(.*)\|(.*)\}\};![\2](\1);g - s;\{\{attachment:(.*)\}\};![](\1);g - s;\[\[(.*)\|(.*)\|(.*)\]\];[\2](\1);g - s;\[\[(.*)\|(.*)\]\];[\2](\1);g + s;\{\{attachment:([^}|]*)\|([^}|]*)\|([^}|]*)\}\};![\2](\1 "\3");g + s;\{\{attachment:([^}|]*)\|([^}|]*)\}\};![\2](\1);g + s;\{\{attachment:([^}|]*)\}\};![](\1);g + s;\[\[([^]|]*)\|([^]|]*)\|([^]|]*)\]\];[\2](\1);g + s;\[\[([^]|]*)\|([^]|]*)\]\];[\2](\1);g /\{\{\{+#!wiki/{ s;\{;:;g; @@ -40,7 +40,7 @@ reformat() { /^\}\}\}+$/s;\};:;g; :MACRO - s;<<([^\(>]+)\(([^,)]+)([^)]*)\)>>;<<\1 "\2"(\3)>>;g; + s;<<([^\(>]+)\(([^,)]+),?([^)]*)\)>>;<<\1 "\2"(\3)>>;g; tMACRO s;<<([^\(>]+)\(\)>>;<<\1>>;g; '