diff --git a/CHANGES b/CHANGES index 5692d38f112..3efd01c3ae1 100644 --- a/CHANGES +++ b/CHANGES @@ -49,6 +49,7 @@ Bugs fixed * HTML Search: HTML tags are displayed as a part of object name * HTML Search: search snipets should not be folded * HTML Search: Minor errors are emitted on fetching search snipets +* HTML Search: The markers for header links are shown in the search result * #10520: HTML Theme: Fix use of sidebar classes in ``agogo.css_t``. * #6679: HTML Theme: Fix inclusion of hidden toctrees in the agogo theme. * #10566: HTML Theme: Fix enable_search_shortcuts does not work diff --git a/sphinx/themes/basic/static/searchtools.js b/sphinx/themes/basic/static/searchtools.js index f656da73b98..f2fb7d5cf7e 100644 --- a/sphinx/themes/basic/static/searchtools.js +++ b/sphinx/themes/basic/static/searchtools.js @@ -156,7 +156,7 @@ const Search = { htmlToText: (htmlString) => { const htmlElement = new DOMParser().parseFromString(htmlString, 'text/html'); - htmlElement.querySelectorAll(".headerlink").forEach((el) => el.parentNode.removeChild(el)); + htmlElement.querySelectorAll(".headerlink").forEach((el) => { el.remove() }); const docContent = htmlElement.querySelector('[role="main"]'); if (docContent !== undefined) return docContent.textContent; console.warn(