-
Notifications
You must be signed in to change notification settings - Fork 4k
Description
Context
No response
Bug description
When a heading contains inline code and search terms are contained within the heading itself, only the portions of the heading which matched the terms are displayed to the user, with the rest of the heading being omitted entirely.
The result of this is incomplete information being shown to the user and, depending on the text that's missing, can display confusing and/or factually incorrect results to the user.
Note: If the matched search term(s) are contained in the content beneath the heading only (i.e. not within the heading itself) then the headings are displayed properly.
Related links
- Reporting a bug
- I searched the documentation, discussions and issues to determine if this is expected behaviour and the closest I'm able to find is the Built-in typeset plugin documentation, which this behaviour does seem to contradict.
Reproduction
While I'm happy to provide this if needed, I don't think it provides any benefit in this particular case as the issue is easily reproducible without any special configuration and easily demonstrable using the official project documentation. In lieu of a reproduction .zip, I took screenshots of the official documentation and took care to ensure that they include the URL and version number in them. As such, these can be used as additional examples of steps of steps to reproduce.
Here are screenshots showing numerous ways the Creating a .zip file section in the official project documentation can be displayed depending on the search terms. Section is located on the Creating a reproduction page, coincidentally enough.
❌ Search for zip shows only Creating a .zip:

❌ Searching for file shows only file:

✔ Searching for text beneath shows the full heading properly (Creating a .zip file):

Here's another example, showing the same behaviour on a page heading (rather than section heading), using the Using git sparse-checkout for faster documentation builds page in the official project documentation:
❌ Searching for git sp shows only Using git sparse-checkout:

❌ Searching for docum shows only for faster documentation builds:

✔ As with the example above, searching for text beneath it shows the full heading correctly (Using git sparse-checkout for faster documentation builds):

If you'd still like a reproduction .zip, please just let me know and I'll be happy to provide one.
Steps to reproduce
1. Use inline code in a heading in a markdown file in the documentation.
e.g.
# PLEASE `DO` `NOT` TRY THIS AT HOME!!
2. Perform a search using the built-in search plugin.
A search for home results in: TRY THIS AT HOME:
A search for please results in: PLEASE DO:
(As a side note, I do see that the exclamation marks are missing too but I haven't investigated it well enough yet to be confident it's a bug. )
Browser
No response
Before submitting
- I have read and followed the bug reporting guidelines.
- I have attached links to the documentation, and possibly related issues and discussions.
- I assure that I have removed all customizations before submitting this bug report.
- I have attached a .zip file with a minimal reproduction.

