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

Search on pages with spaces creates invalid links #1956

Closed
4 tasks done
sbonds opened this issue Sep 30, 2020 · 3 comments
Closed
4 tasks done

Search on pages with spaces creates invalid links #1956

sbonds opened this issue Sep 30, 2020 · 3 comments
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open

Comments

@sbonds
Copy link

sbonds commented Sep 30, 2020

I checked that...

  • ... the documentation does not mention anything about my problem
  • ... the problem doesn't occur with the default MkDocs template
  • ... the problem is not in any of my customizations (CSS, JS, template)
  • ... there are no open or closed issues that are related to my problem

Description

When search results include an URL with spaces in its name the resulting search result link does not exist.

Expected behavior

Search results will contain links to the content containing search hits even if the page URLs have spaces in them.

Actual behavior

The results of a search has the spaces (%20) in URLs replaced by '+' which is no longer a valid link.

Steps to reproduce the bug

  1. Go to the demo site created at https://sbonds.github.io/mkdocs-simple-demo/
  2. Search for "spaces"
  3. Follow the link to "doc file with spaces"
  4. Observe the mangled 404 page at https://sbonds.github.io/mkdocs-simple-demo/doc+file+with+spaces/

Package versions

The build is automated via https://github.com/sbonds/mkdocs-simple-demo/blob/master/.travis.yml

  • Python: Python 3.7.1
  • MkDocs: mkdocs, version 1.1.2 from /home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/mkdocs (Python 3.7)
  • Material: Version: 6.0.1

Project configuration

The whole thing is available at https://github.com/sbonds/mkdocs-simple-demo/blob/master/mkdocs.yml

This is intentionally simplified to provide a testbed for issues observed in a much more complex environment.

site_name: Simple public demo for mkdocs
nav:
- home: index.md
theme: 
  name: material
  palette:
    primary: 'white'
    accent: 'blue'
  features:
    # https://squidfunk.github.io/mkdocs-material/upgrading/#upgrading-from-5x-to-6x
    - navigation.tabs
repo_url: https://github.com/sbonds/mkdocs-simple-demo
repo_name: 'GitHub'
edit_uri: tree/master/docs/
extra:
  contact:
    name: 'Steve Bonds'
    email: 'sbonds@gmail.com'
markdown_extensions:
- mdx_truly_sane_lists

System information

Web client info:

  • OS: Windows 10
  • Browser: Chrome 85.0.4183.121
@squidfunk squidfunk added the bug Issue reports a bug label Oct 1, 2020
@squidfunk
Copy link
Owner

Thanks for reporting! That’s indeed a bug introduced in 6.0.

@squidfunk
Copy link
Owner

squidfunk commented Oct 1, 2020

Fixed in bf9f9bf.

@squidfunk squidfunk added the resolved Issue is resolved, yet unreleased if open label Oct 1, 2020
@sbonds
Copy link
Author

sbonds commented Oct 1, 2020

I adjusted the .travis.yml for the above mkdocs demo site to use your latest commit and the problem seems to have been resolved. Thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open
Projects
None yet
Development

No branches or pull requests

2 participants