On 19/02/2016 21:00, Holger Freyther wrote:
> In trac we have:
> 
>       [[Image(motorola_filter_replacement_step_1_low.jpg, 250px)]]
> 
> For redmine we need:
> 
>       {{thumbnail(motorola_filter_replacement_step_1_low.jpg, size=250)}}
> 
> Anyone wants to try his luck with a regexp to do this automatically?
> Or a bit of ruby code to split and manipulate if it is matching [[Image?

This works for me:

$ REGEXP='s/\[\[Image(\([^,]*\), *\([0-9]*\)px)\]\]/{{thumbnail(\1,
size=\2)}}/'
$ echo '[[Image(motorola_filter_replacement_step_1_low.jpg, 250px)]]' |
sed -e "$REGEXP"
{{thumbnail(motorola_filter_replacement_step_1_low.jpg, size=250)}}

HTH,
-- 
khorben

Reply via email to