Skip to content

Commit

Permalink
HTML Search: refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
tk0miya committed Jul 18, 2022
1 parent 6ed7405 commit 4dd09eb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion sphinx/themes/basic/static/searchtools.js
Expand Up @@ -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(
Expand Down

0 comments on commit 4dd09eb

Please sign in to comment.