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;
/^\}\}\}+$/s;\};:;g;
:MACRO
- s;<<([^\(>]+)\(([^,)]+)([^)]*)\)>>;<<\1 "\2"(\3)>>;g;
+ s;<<([^\(>]+)\(([^,)]+),?([^)]*)\)>>;<<\1 "\2"(\3)>>;g;
tMACRO
s;<<([^\(>]+)\(\)>>;<<\1>>;g;
'