jbms / sphinx-immaterial

Adaptation of the popular mkdocs-material material design theme to the sphinx documentation system
https://jbms.github.io/sphinx-immaterial/
Other
177 stars 28 forks source link

Fix the JavaScript search term splitting for compound words #307

Closed jbms closed 6 months ago

jbms commented 6 months ago

Previously, the JavaScript search code split the search query only on spaces, which meant that with a search query of a compound word like "mkdocs-material", for example, would be treated as a single term "mkdocs-material". In contrast, when building the search index, the /\w+/ regexp is used to split compound words, such that the index would only contain "mkdoc" and "material" as separate terms. Consequently, "mkdocs-material" as a single term would never be found.

With this change, the JavaScript search query splitting has been changed to match what is done when building the index.

Fixes #262.

2bndy5 commented 6 months ago

I'll push a patch bump later when the CI is all caught up.