-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
Describe the bug
My understanding (that could be mistaken) about the html_show_search_summary feature (enabled by default) is that each search result displayed to the user should have a relevant snippet of the content displayed alongside, to aid the user's determination of which result(s) are most relevant.
When the feature is enabled, we make an HTTP request to each result and display a portion of that using JavaScript.
How to Reproduce
Build the Sphinx documentation locally and then run a basic webserver to host it:
sphinx.git $ sphinx-build -b html doc _build
sphinx.git $ cd _build
sphinx.git $ python -m http.server -b 127.0.0.1Open http://127.0.0.1:8000 in a web browser, and perform a search for the query term test.
Observe that multiple results with separate HTML anchor targets appear in the search results. However: they display the same search snippet (not useful - this is the bug).
Environment Information
Platform: linux; (Linux-6.6.13-amd64-x86_64-with-glibc2.37)
Python version: 3.11.7 (main, Dec 8 2023, 14:22:46) [GCC 13.2.0])
Python implementation: CPython
Sphinx version: 7.2.6
Docutils version: 0.20.1
Jinja2 version: 3.1.3
Pygments version: 2.17.2
Sphinx extensions
No response
Additional context
Discovered during investigation of #11942.
