elm-community / elm-faq

FAQ about the Elm language.

Home Page:https://faq.elm-community.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Search field "too" case-sensitive?

jvoigtlaender opened this issue · comments

Actually, it seems to be case sensitive for some content, but not for other content. At least I cannot otherwise explain why there is a difference in behavior (filtered results) between starting to type "Repl" vs. "repl", but no such difference between starting to type "Report" vs. "report".

And it's unfortunate that there is such case sensitivity, since at least on mobile for me, when I start typing in an empty input field, it always starts uppercase...

The search works as in Emacs: if the search string contains any upper-case characters then the search is done case-sensitive; otherwise it is case-insensitive.

https://github.com/fredcy/doc-filter/blob/de2d61fc9241988053df1e19ddfd47568d38bda9/Filter.elm#L105

It's easy to change the program such that search is always case-insensitive, of course. Is that what you want? Perhaps the approach I used is not as commonly understood as I thought.

Ah, I see. So the difference between the cases of "repl" and "report" was due to to me invisible words inside the section content (I thought only titles are searched).

But anyway, while I do use Emacs and know about the behaviour there, I would expect the search on the site here to be completely case insensitive.

A cheap justification would be that that's exactly like the search box on the Elm package site works.

OK, the search is now case-insensitive.