pandoc / lua-filters

A collection of lua filters for pandoc
MIT License
602 stars 165 forks source link

Avoid Inkscape 1.0 deprecation warnings #227

Closed postylem closed 2 years ago

postylem commented 2 years ago

Update the arguments passed to Inkscape, in order to be in line with current Inkscape argument formats (introduced in Inkscape 1.0, released May 2020).

The current arguments passed to Inkscape result in warnings being printed, if the Inkscape version is 1.0 or later.


Updating these arguments avoids the following deprecation warnings (which are safe to ignore, but annoying):

Warning: Option --without-gui= is deprecated
Warning: Option --file= is deprecated

and

Warning: Option --export-plain-svg= is deprecated

if the format is svg, or

Warning: Option --export-png= is deprecated

if the format is png.

postylem commented 2 years ago

I just noticed that this has been commented on before in #144, but not implemented in a PR? This is my first PR here, so I hope I'm being helpful.

postylem commented 2 years ago

OK, I saw that the test CI is running with Ubuntu 20.04 on a docker container which has Inkscape v0.92.5 installed. So this doesn't pass the test on that setup since the new argument format is not accepted by the old Inkscape. I missed that before.

I just pushed a fix which checks the Inkscape version and uses the new argument format only if the version is 1.0 or higher.

tarleb commented 2 years ago

Thanks!

We could avoid re-checking the version for every graphic, but the performance impact should be small. It's probably not a big issue.