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 the term C++
is broken
#8123
Comments
Hmm .. I just saw, that this happens on purpose, somewhat above:
|
When trying to fix it locally, I ran into:
which I fixed using the attached patch |
Ok, Now I see, why
was done.
|
C++
is broken
Thank you for reporting. But, unfortunately, our indexer does not support a word containing "+". So it will be failed even if we fixed the decoding logic because search-index does not contain "C++" as a keyword. |
we have defined a custom search-language with a custom splitter that is very simple and doesn't throw away punctutations, thus in our (commercial) project we can now nicely search for
we also are locally applying 2 more patches to searchtools.js removing the feature that excludes searchterms with a leading The leading I would be willing to start a PR dumping in these changes if someone is interested, however I don't think I'd have the time to get this merge-ready. |
…ic html theme search Note, that the default splitter will not index +, so this isn't of much of much use, unless the splitter of the search-language is reconfigured.
Describe the bug
Instead of searching for
C++
sphinx searches forC
(two spaces after the C)I've done some investigation on the matter:
sphinx/sphinx/themes/basic/static/doctools.js
Line 54 in af62fa6
These two lines
do too much decoding. Instead I suppose that https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent should be used.
To Reproduce
Go to https://www.sphinx-doc.org/en/master/search.html?q=C%2B%2B
On the sphinx search page In your browser's Javascript Console, type
->
C
so sphinx will actually search for
C
instead ofC++
.Expected behavior
I would like sphinx to search for
C++
The text was updated successfully, but these errors were encountered: