-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Searching for integers or version numbers does not work #1773
Comments
OkHTTP is Running Material 4.x, so I guess this is a regression as there’s no reason why searching for numbers shouldn’t work. It might be related to the transform function that is applied before the query is sent to lunr.js. |
Fixed in a3c03ae. Now that was a super funny bug. It's coming from the search transform's first replacement, which removes rogue control characters:
The
|
Amazing, thank you so much for fixing this! I'm glad you enjoyed the challenge :) |
Released as part of 5.3.3 |
I installed 5.3.3, and the bug does not seem to be fixed completely, or else the behaviour is not quite what I expected.
It looks like this incorrect range "+-:" is used in other files: transform/index.ts And in the document cleanup, the "." is being stripped out. This may be removing valid characters. When looking for Docker tag versions, users may want to include the ":" character. |
Yes, it should be highlighted.
What do you mean by "breaks"? Try searching for "5.1.2" on the official docs - everything works fine including type-ahead.
Oh yes, I guess I missed the other occurrences! Feel free to submit a PR, so we can get highlighting back to work. Using a
The regex does only apply to those characters if they are preceded by whitespace, i.e. |
Maybe I'm doing something wrong, but if I leave the config.separator as the default value ( "[\s-]+" ) in partials/language/en.html I am able to look for something like "v1.0.0" However, if I include "." as a separator ( "[\s-.]+" ), this functionality breaks. Am I doing something wrong? |
|
Additional fix for #1773 to include highlighting integers.
* Further updates for #1773 * Update search.9b3611bd.min.js
I checked that...
Description
When searching for numbers, either on their own, or as part of a word (e.g. SHA256), the search function does not yield any results.
Expected behavior
I would expect that, by default, searching for numbers (integers) would be supported. In fact, it seems like it used to be supported, but has been removed or disabled.
Steps to reproduce the bug
On my own installation of Material for Mkdocs, I've tested modifying the search.config.pipeline to remove the trimmer and stopWordFilter, but nothing seems to impact the behavior of looking for numbers or digits with decimal points.
The text was updated successfully, but these errors were encountered: