Skip to content

Search results encode & as & #8440

@kendralockard

Description

@kendralockard

Context

No response

Bug description

When searching for terms that contain an ampersand (&), MkDocs search results display & instead of &.

This occurs both on my company documentation site that uses MkDocs, as well as on the official MkDocs documentation site itself (https://squidfunk.github.io/mkdocs-material/).

Example (here):
Image

Related links

Similar issues have been opened and closed in the past, but the problem persists.

Reproduction

I tried but cannot reproduce this bug in a minimal site locally. But, it happens on https://squidfunk.github.io/mkdocs-material/ and our production site.

Steps to reproduce

  1. Open https://squidfunk.github.io/mkdocs-material/ in a browser.
  2. Use the search bar to search for a phrase with an ampersand, e.g., Your knowledge & skills.
  3. All ampersands are shown as &.

Browser

Safari, Firefox

Before submitting

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue reports a bugresolvedIssue is resolved, yet unreleased if open

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions