Skip to content
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 C++ doc by URL is broken #2463

Open
AMagill opened this issue Mar 20, 2025 · 3 comments · May be fixed by #2469
Open

Searching C++ doc by URL is broken #2463

AMagill opened this issue Mar 20, 2025 · 3 comments · May be fixed by #2469
Labels

Comments

@AMagill
Copy link

AMagill commented Mar 20, 2025

Bug report

OS information

Tested using:

  • Windows Chrome 134.0.6998.89
  • Android Chrome 134.0.6698.96
  • Windows Firefox 136.0.1
  • Android Firefox 136.0.2

Steps to reproduce

Enter URL in browser:
https://devdocs.io/#q=c++%20std::min

According to http://devdocs.io/help#search, that should do a search in the C++ doc for std::min. Instead, it searches the C++ doc for std::min, with two leading spaces, and shows poor quality search results. Manually removing those leading spaces in the search box causes good search results to come up again.

I've used this feature for keyword searches from my browsers' URL bar for a long time, except as https://devdocs.io/#q=cpp%20%s (cpp rather than c++), but starting very recently, that no longer selects the doc I intended.

Possible fix

Trim leading spaces on C++ search terms from the URL!

Alternatively, it seems like it would be slightly cleaner if single-doc searches could be done with URLs like:
https://devdocs.io/cpp/#q=std::min

@AMagill AMagill added the bug label Mar 20, 2025
@noirgif
Copy link

noirgif commented Mar 21, 2025

Currently https://devdocs.io/#q=c+{Query} is a workaround for me. It seems that each plus sign adds an extra space. I guess that's how query string parsing works

@AMagill
Copy link
Author

AMagill commented Mar 21, 2025

@noirgif Nice workaround, thank you!

@alexchantastic
Copy link

alexchantastic commented Mar 23, 2025

I think this is generally happening across all docs when encoding spaces as %20. Unfortunately, the workaround @noirgif proposed is not working for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants