Skip to content

Commit

Permalink
fix search plugin ignoring diacritics
Browse files Browse the repository at this point in the history
  • Loading branch information
t-fritsch committed Nov 20, 2023
1 parent bbd0d3e commit d0b26d0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion plugin/search/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ const Plugin = () => {

this.setRegex = function(input)
{
input = input.replace(/^[^\w]+|[^\w]+$/g, "").replace(/[^\w'-]+/g, "|");
input = input
.replace(/^[^\wÀ-ž]+|[^\wÀ-ž]+$/g, "") // trim non alphanumeric chars at the beginning and at the end
.replace(/[^\wÀ-ž'-]+/g, "|"); // replace all others non alphanumeric chars (except - and ') with a `|` (logical OR)
matchRegex = new RegExp("(" + input + ")","i");
}

Expand Down
2 changes: 1 addition & 1 deletion plugin/search/search.esm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugin/search/search.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d0b26d0

Please sign in to comment.