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 search term match and highlight for Unicode chars #347

Closed Bizordec closed 1 month ago

Bizordec commented 2 months ago

A regular expression /\w+/g was added in PR #307, which broke the search for non-english words.

I changed it to /\p{L}+/gu to add support for all Unicode characters and removed redundant word boundary (\b) in highlight regex.

2bndy5 commented 2 months ago

[!NOTE] The search implementation will be changing completely upon merging #338; it will more closely follow upstream's behavior known as "the builtin search plugin". I doubt this hack would be needed after that. Furthermore, this hack might become more of a user customization.

Bizordec commented 1 month ago

Ok then, for now I'll rollback to v0.11.9, since this version has working search (but not highlighting) for Unicode.