Skip to content

Searching C++ doc by URL is broken #2463

Open
@AMagill

Description

@AMagill

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

Activity

noirgif

noirgif commented on Mar 21, 2025

@noirgif

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

AMagill commented on Mar 21, 2025

@AMagill
Author

@noirgif Nice workaround, thank you!

alexchantastic

alexchantastic commented on Mar 23, 2025

@alexchantastic

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @alexchantastic@AMagill@noirgif

      Issue actions

        Searching C++ doc by URL is broken · Issue #2463 · freeCodeCamp/devdocs