-
Notifications
You must be signed in to change notification settings - Fork 361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect parsing of "+" in labels, titles and possiblely elsewhere #576
Comments
We can do a better job I think. But inside the code there are no quotes - that is only in the shell - so what GMT sees is WSen+tTitle+ and (except for this case) it can be hard to tell what is a modifier and what is part of the text. My usual solution is to scan the entire argument before parsing and if I find sequences of + that are not among the possible modifiers to that option then replace the + with an unprintable character and then replace those back to + after the parsing. Of course, to catch +tTitle+testing we need to remember that +t was already found and allow that second +t as part of the text, but +tTitle+gravity is harder since +g is a valid option. It is getting pretty messy then to check that ravity is not a color, etc. |
The other way to handle this is to escape plus symbols in text: +tTitle+testing which is probably preferable to making people use the octal code for plus: +tTitle\053testing. |
It seems there is no easy way to parse "+" correctly. I'm OK with the octal code. Feel free to close this issue. |
I am improving it a bit. The missing + in your example is a bug and is being fixed. Also, I am implementing that any repeat + in a string is not a modifier since you cannot repeat a modifier. So that fixes +tTitle+testing for instance. The +tTitle+gravity actually gives
|
The trailing "+" in labels and title are missing.
The text was updated successfully, but these errors were encountered: