-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Allow for escape syntax to enable literal placeholders #11904
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1059,6 +1059,15 @@ QString Entry::resolveMultiplePlaceholdersRecursive(const QString& str, int maxD | |
return str; | ||
} | ||
|
||
// Short circuit if we have escaped the placeholder brackets | ||
if (str.startsWith("\\{") && str.endsWith("\\}")) { | ||
// Replace the escaped brackets with actuals and move on | ||
auto ret = str; | ||
ret.replace(0, 2, "{"); | ||
ret.replace(ret.size() - 2, 2, "}"); | ||
return ret; | ||
} | ||
|
||
Comment on lines
+1062
to
+1070
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a very brittle escaping mechanism. Either we need a proper state machine for parsing the syntax or this should at least be part of the regex, e.g. as negative lookbehinds/lookaheads. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @phoerious |
||
QString result; | ||
auto matches = placeholderRegEx.globalMatch(str); | ||
int capEnd = 0; | ||
|
Uh oh!
There was an error while loading. Please reload this page.