Join GitHub today
svg double hyphen in plot title -- #1967
a double hyphen in plot title breaks the svg output because the double hyphen
now try and open svg output it with firefox and it will point at the error line, 479 in version 1.2.1. which contains:
but xml comments cannot contain
I could not find in the stdlib a standard way to escape/unescape double hyphens, but if anyone does, we should use it.
if an standard way does not exist, my proposed solution is: replace
and that this be done in an overlapping manner:
This can be achieved with the following class:
I just don't know exactly where to plug this, but it should take 5 mins for someone who knows the svg
I'm sorry but I haven't yet been able to install matplotlib from source to test it out, I'll try to do that
for the time being, I see that you approach is based on
so the comment would still broken (please check). I think the way to go is still with
which works because of the lookahead: "---" --> "- - -"
as for unscapping, I agree that it is not directly necessary for matplotlib, I just feel it is a good practice to give unscape to escapes, since one day some user will want to use the comment content grammatically and will have to write this himself. Of course, not sure it is worth the extra code maintenance...