1
0
Fork 0
mirror of https://github.com/em-squared/5e-drs.git synced 2025-10-31 13:34:21 +00:00

corrections mineurs + support de la recherche diacritique

This commit is contained in:
Maxime Moraine 2020-06-09 16:11:19 +02:00
parent a1336b572a
commit 162090e1fe
4 changed files with 14 additions and 2 deletions

View file

@ -12,6 +12,7 @@ export default (query, page, additionalStr = null) => {
if (additionalStr) {
domain += ` ${additionalStr}`
}
query = slugify(query, {lower: true, strict: true})
domain = slugify(domain, {lower: true, strict: true})
@ -19,6 +20,7 @@ export default (query, page, additionalStr = null) => {
}
const matchTest = (query, domain) => {
const escapeRegExp = str => str.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&')
const words = query