mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
HTML Search: Minor errors are emitted on fetching search snipets
This commit is contained in:
parent
50897f0cc2
commit
6ed7405cd9
1
CHANGES
1
CHANGES
@ -48,6 +48,7 @@ Bugs fixed
|
|||||||
* #10460: logging: Always show node source locations as absolute paths.
|
* #10460: logging: Always show node source locations as absolute paths.
|
||||||
* HTML Search: HTML tags are displayed as a part of object name
|
* HTML Search: HTML tags are displayed as a part of object name
|
||||||
* HTML Search: search snipets should not be folded
|
* HTML Search: search snipets should not be folded
|
||||||
|
* HTML Search: Minor errors are emitted on fetching search snipets
|
||||||
* #10520: HTML Theme: Fix use of sidebar classes in ``agogo.css_t``.
|
* #10520: HTML Theme: Fix use of sidebar classes in ``agogo.css_t``.
|
||||||
* #6679: HTML Theme: Fix inclusion of hidden toctrees in the agogo theme.
|
* #6679: HTML Theme: Fix inclusion of hidden toctrees in the agogo theme.
|
||||||
* #10566: HTML Theme: Fix enable_search_shortcuts does not work
|
* #10566: HTML Theme: Fix enable_search_shortcuts does not work
|
||||||
|
@ -155,9 +155,7 @@ const Search = {
|
|||||||
_pulse_status: -1,
|
_pulse_status: -1,
|
||||||
|
|
||||||
htmlToText: (htmlString) => {
|
htmlToText: (htmlString) => {
|
||||||
const htmlElement = document
|
const htmlElement = new DOMParser().parseFromString(htmlString, 'text/html');
|
||||||
.createRange()
|
|
||||||
.createContextualFragment(htmlString);
|
|
||||||
htmlElement.querySelectorAll(".headerlink").forEach((el) => el.parentNode.removeChild(el));
|
htmlElement.querySelectorAll(".headerlink").forEach((el) => el.parentNode.removeChild(el));
|
||||||
const docContent = htmlElement.querySelector('[role="main"]');
|
const docContent = htmlElement.querySelector('[role="main"]');
|
||||||
if (docContent !== undefined) return docContent.textContent;
|
if (docContent !== undefined) return docContent.textContent;
|
||||||
|
Loading…
Reference in New Issue
Block a user