Closed ghost closed 4 years ago
Hm, good catch!
I am leaning towards doing the escaping in the output module and expecting modules to not escape. Having a mix and match invites strange errors, I believe.
How would that sound to you? The fix would be fairly trivial, I think (will commit it, we can always change it later)
Hopefully there's nothing wrong with this approach: since the addition of pango markup support is pretty new, there shouldn't be too many third party setups that will end broken due to double escaping.
Bug Report
Summary
Affected module: many
Description:
The pango markup specification requires to escape the '&' char as '\&' . If it's not happening, a warning is displayed:
Probably bumblebee shouldn't blindly escape everything, because certain users may know about it and pass already escaped data as parameters.
Yet, it's a good idea to improve the help message for --markup option and explicitly warn the user about the need to escape '&' in parameters and in output produced by custom scripts used by shell.command.
And of course, plugins that display filenames/metadata (like mpd, cmus, etc) will have to be patched so they escape '&' if --markup=pango is used.
How to reproduce
Here is a simple example:
Another example: try playing an audio file that has '&' in the file name (because this is a legit symbol in file names) and use one of the {file} tags in mpd.format and --markup=pango - bumblebee won't display anything as well, just the buttons - this is how I initially spotted the bug.