summaryrefslogtreecommitdiff
path: root/sphinx/themes/basic/static
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2022-06-26 23:22:39 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2022-07-18 23:05:57 +0900
commit6ed7405cd9da2ba78f54f90e2decf895cbc25bf2 (patch)
tree69526eba7603321fd887fbd37af868665967cc26 /sphinx/themes/basic/static
parent50897f0cc248241067d520fede5e5b9f6aca0175 (diff)
downloadsphinx-git-6ed7405cd9da2ba78f54f90e2decf895cbc25bf2.tar.gz
HTML Search: Minor errors are emitted on fetching search snipets
Diffstat (limited to 'sphinx/themes/basic/static')
-rw-r--r--sphinx/themes/basic/static/searchtools.js4
1 files changed, 1 insertions, 3 deletions
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;