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
#1654: Handle entity properties containing double quotation marks #1688
Conversation
Pasting this:
shows up in the UI as Otherwise everything looks good. |
That's because it interprets two consecutive backslashes as one escaped backslash. So strictly speaking, backslashes will have to be escaped, and they are when TB writes the map file. |
See also the additional test case. |
Is the escape character This implies it is:
but then this fails:
Btw, raw string literals are working in ELParserTest.parseStringLiteralWithDoubleQuotationMarks: |
const String data("{" | ||
"\"classname\" \"worldspawn\"" | ||
"\"path\" \"c:\\\\a\\\\b\\\\c\\\\\"" | ||
"}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this work?
const String data(R"({)"
R"("classname" "worldspawn")"
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had used raw string literals, only to have VC++ being unable to parse them. So they are banned, sorry.
It is. |
Should not have failed. It's fixed now. Thanks for the thorough review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good now!
I'm sure something else will break on windows or something. Goddamn backslashes. |
Closes #1654.
Double quotation marks are marked as issues. Two quick fixes are available: Delete property and Replace double with single quotation marks. Furthermore, they are escaped with backslashes when writing a map, and are unescaped when reading again.