This happened when I tried to search for a word in multiple objects. All of the objects contained the key body which contains markdown text. In some of the field the word is found in other cases it is not. I guess it has to do something with the special characters used in markdown. It can be best seen in my example down below!
Version
Fuse: 6.4.0
Node Version: 12.16.1
Same result in Firefox: 78
Is this a regression?
Stumbled up on this the first time
🔬Minimal Reproduction
const Fuse = require('fuse.js');
const data = [{
"title": "Title 1",
"body": "# 111111 \n bla \n \n asdf\n \n asdf\nThis will be found",
}, {
"title": "Title 2",
body: "# 22222 2\n- [x] asdf\n- [x] asdf\n- [x] 123ed\n\t- [ ] asdf\n\t- [ ] asdf\n\t\t- [ ] asdf\n\t\t\t- [ ] asdf\n\n- asdf\n- asdf\n- asdf\n\nasdf\n\nasdf\n\nThis will not be found",
}, {
"title": "Title 3",
"body": "# 33333 \n bla blupp asdf asdf asdf\n \n asdf\n asdf",
}]
const fuse = new Fuse(data, {
keys: [
'title',
'body',
]
});
console.log(fuse.search('found'));
Result:
$ node index.js
[
{
item: {
title: 'Title 1',
body: '# 111111 \n bla \n \n asdf\n \n asdf\nThis will be found'
},
refIndex: 0
}
]
Expected
At least that the second object is also found since ther word found is also present in its body
Additional context
The content of the body field looks so strange since its markdown. My guess is that this is the cause of the problem but i was not able to narrow it down to a smaller example for the second object!
Describe the bug
This happened when I tried to search for a word in multiple objects. All of the objects contained the key
body
which contains markdown text. In some of the field the word is found in other cases it is not. I guess it has to do something with the special characters used in markdown. It can be best seen in my example down below!Version
Fuse: 6.4.0 Node Version: 12.16.1 Same result in Firefox: 78
Is this a regression?
Stumbled up on this the first time
🔬Minimal Reproduction
Result:
Expected At least that the second object is also found since ther word
found
is also present in its bodyAdditional context
The content of the body field looks so strange since its markdown. My guess is that this is the cause of the problem but i was not able to narrow it down to a smaller example for the second object!