Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
ddc42a61
Commit
ddc42a61
authored
Dec 09, 2016
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug where token values with 2 double quotes were not treated as a complete value
parent
f0608878
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
app/assets/javascripts/filtered_search/filtered_search_tokenizer.es6
...javascripts/filtered_search/filtered_search_tokenizer.es6
+11
-4
No files found.
app/assets/javascripts/filtered_search/filtered_search_tokenizer.es6
View file @
ddc42a61
...
@@ -119,19 +119,26 @@
...
@@ -119,19 +119,26 @@
const keyMatch = validTokenKeys.filter(v => v.key === tokenKey)[0];
const keyMatch = validTokenKeys.filter(v => v.key === tokenKey)[0];
const symbolMatch = validTokenKeys.filter(v => v.symbol === tokenSymbol)[0];
const symbolMatch = validTokenKeys.filter(v => v.symbol === tokenSymbol)[0];
const doubleQuoteOccurrences = tokenValue.split('"').length - 1;
const singleQuoteOccurrences = tokenValue.split('\'').length - 1;
const doubleQuoteIndex = tokenValue.indexOf('"');
const doubleQuoteIndex = tokenValue.indexOf('"');
const singleQuoteIndex = tokenValue.indexOf('\'');
const singleQuoteIndex = tokenValue.indexOf('\'');
const doubleQuoteExist = doubleQuoteIndex !== -1;
const doubleQuoteExist = doubleQuoteIndex !== -1;
const singleQuoteExist = singleQuoteIndex !== -1;
const singleQuoteExist = singleQuoteIndex !== -1;
if ((doubleQuoteExist && !singleQuoteExist) ||
const doubleQuoteExistOnly = doubleQuoteExist && !singleQuoteExist;
(doubleQuoteExist && singleQuoteExist && doubleQuoteIndex < singleQuoteIndex)) {
const doubleQuoteIsBeforeSingleQuote = doubleQuoteExist && singleQuoteExist && doubleQuoteIndex < singleQuoteIndex;
const singleQuoteExistOnly = singleQuoteExist && !doubleQuoteExist;
const singleQuoteIsBeforeDoubleQuote = doubleQuoteExist && singleQuoteExist && singleQuoteIndex < doubleQuoteIndex;
if ((doubleQuoteExistOnly || doubleQuoteIsBeforeSingleQuote) && doubleQuoteOccurrences % 2 !== 0) {
// " is found and is in front of ' (if any)
// " is found and is in front of ' (if any)
lastQuotation = '"';
lastQuotation = '"';
incompleteToken = true;
incompleteToken = true;
} else if ((singleQuoteExist && !doubleQuoteExist) ||
} else if ((singleQuoteExistOnly || singleQuoteIsBeforeDoubleQuote) && singleQuoteOccurrences % 2 !== 0) {
(doubleQuoteExist && singleQuoteExist && singleQuoteIndex < doubleQuoteIndex)) {
// ' is found and is in front of " (if any)
// ' is found and is in front of " (if any)
lastQuotation = '\'';
lastQuotation = '\'';
incompleteToken = true;
incompleteToken = true;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment