Navigation Menu

Skip to content

Commit

Permalink
q: support <\"> in phrase term
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Aug 3, 2012
1 parent ecbf310 commit 61c70fe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/q-translator.js
Expand Up @@ -48,6 +48,7 @@ QueryTranslator.prototype = {
}

if (character == "\\") {
phrase += character;
this.offset++;
character = this.query[this.offset];
}
Expand Down
4 changes: 4 additions & 0 deletions test/q-translator.test.js
Expand Up @@ -72,6 +72,10 @@ suite('QueryTranslator', function() {
'"star wars" luke',
'"star wars"'.length,
"'\"star wars\"'");
testPhraseTerm("escape",
'"star \\" wars" luke',
'"star \\" wars"'.length,
"'\"star \\\" wars\"'");

testTerm("a term",
" star wars",
Expand Down

0 comments on commit 61c70fe

Please sign in to comment.