rust-lang / rust-lang/mdBook

Searches including hashes (#) fail when linked to

Open
#2,745 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-Search C-bug
Dominant language
Rust
Stars
22.2k
Forks
1.9k
PR merge metrics
PR metrics pending

Description

Problem

I have tags in my pages and am linking them to searches. If I link to ?search=blog then pages with #blog don't show up. When I search manually for #blog I get the correct results and the URL is search#blog. The issue is that when I link to search#blog, the url gets replaced with search=undefined

Steps
  1. Search for something with a hash at the start
  2. reload the page and watch the search change to undefined
Possible Solution(s)

No response

Notes

No response

Version
mdbook v0.4.51

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue using a linked search for a term beginning with #, then reload the page and compare it with a manually performed search. Trace the search URL handling from the relevant search entry point; done means linked hash searches retain their query instead of becoming undefined and continue returning the expected pages.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
search
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.