Skip to content

Commit

Permalink
Fixes #263
Browse files Browse the repository at this point in the history
  • Loading branch information
claudioc committed Nov 15, 2019
1 parent 36d0332 commit b428ae6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Version 1.9.4 Nov 15th, 2019

- Fixes a bug in the search (closes #263)

# Version 1.9.3 Novc 15th, 2019

- Upgrade ecstatic to a safer version
Expand Down
2 changes: 1 addition & 1 deletion lib/gitmech.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ var gitMech = {

grep: function (pattern, callback) {
// TODO decide for -w
var args = [ 'grep', '--no-color', '-F', '-n', '-i', '-I', pattern ]
var args = [ 'grep', '--no-color', '-F', '-n', '-i', '-I', '-z', pattern ]
if (docSubdir !== '') {
args.push(docSubdir)
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jingo",
"version": "1.9.3",
"version": "1.9.4",
"description": "A nodejs based wiki engine",
"author": "Claudio Cicali <[email protected]>",
"keywords": [
Expand Down
3 changes: 2 additions & 1 deletion routes/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ function _getSearch (req, res) {
models.pages.findStringAsync(res.locals.term).then(function (items) {
items.forEach(function (item) {
if (item.trim() !== '') {
record = item.split(':')
// The null character is added natively by the `git grep` command
record = item.split(/\0/)
res.locals.matches.push({
pageName: path.basename(record[0].replace(/\.md$/, '')),
line: record[1] ? ', L' + record[1] : '',
Expand Down

0 comments on commit b428ae6

Please sign in to comment.