diff options
| author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2022-06-26 23:22:39 +0900 |
|---|---|---|
| committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2022-07-18 23:05:57 +0900 |
| commit | 6ed7405cd9da2ba78f54f90e2decf895cbc25bf2 (patch) | |
| tree | 69526eba7603321fd887fbd37af868665967cc26 | |
| parent | 50897f0cc248241067d520fede5e5b9f6aca0175 (diff) | |
| download | sphinx-git-6ed7405cd9da2ba78f54f90e2decf895cbc25bf2.tar.gz | |
HTML Search: Minor errors are emitted on fetching search snipets
| -rw-r--r-- | CHANGES | 1 | ||||
| -rw-r--r-- | sphinx/themes/basic/static/searchtools.js | 4 |
2 files changed, 2 insertions, 3 deletions
@@ -48,6 +48,7 @@ Bugs fixed * #10460: logging: Always show node source locations as absolute paths. * 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 * #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 563e50af7..f656da73b 100644 --- a/sphinx/themes/basic/static/searchtools.js +++ b/sphinx/themes/basic/static/searchtools.js @@ -155,9 +155,7 @@ const Search = { _pulse_status: -1, htmlToText: (htmlString) => { - const htmlElement = document - .createRange() - .createContextualFragment(htmlString); + const htmlElement = new DOMParser().parseFromString(htmlString, 'text/html'); htmlElement.querySelectorAll(".headerlink").forEach((el) => el.parentNode.removeChild(el)); const docContent = htmlElement.querySelector('[role="main"]'); if (docContent !== undefined) return docContent.textContent; |
