mirror of
https://github.com/em-squared/5e-drs.git
synced 2025-10-29 20:54:19 +00:00
support des caractères accentués dans la recherche
This commit is contained in:
parent
7714cf65f2
commit
a1336b572a
1 changed files with 3 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
|||
|
||||
import get from 'lodash/get'
|
||||
import slugify from 'slugify'
|
||||
|
||||
export default (query, page, additionalStr = null) => {
|
||||
let domain = get(page, 'title', '')
|
||||
|
|
@ -11,6 +12,8 @@ export default (query, page, additionalStr = null) => {
|
|||
if (additionalStr) {
|
||||
domain += ` ${additionalStr}`
|
||||
}
|
||||
query = slugify(query, {lower: true, strict: true})
|
||||
domain = slugify(domain, {lower: true, strict: true})
|
||||
|
||||
return matchTest(query, domain)
|
||||
}
|
||||
|
|
@ -39,4 +42,3 @@ const matchTest = (query, domain) => {
|
|||
)
|
||||
return searchRegex.test(domain)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue