mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
commit
eb5a441671
4
CHANGES
4
CHANGES
@ -46,6 +46,10 @@ Bugs fixed
|
|||||||
* #10031: py domain: Fix spurious whitespace in unparsing various operators (``+``,
|
* #10031: py domain: Fix spurious whitespace in unparsing various operators (``+``,
|
||||||
``-``, ``~``, and ``**``). Patch by Adam Turner.
|
``-``, ``~``, and ``**``). Patch by Adam Turner.
|
||||||
* #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: 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``.
|
* #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
|
||||||
|
@ -88,7 +88,7 @@ const _displayItem = (item, highlightTerms, searchTerms) => {
|
|||||||
linkEl.href = linkUrl + "?" + params.toString() + anchor;
|
linkEl.href = linkUrl + "?" + params.toString() + anchor;
|
||||||
linkEl.innerHTML = title;
|
linkEl.innerHTML = title;
|
||||||
if (descr)
|
if (descr)
|
||||||
listItem.appendChild(document.createElement("span")).innerText =
|
listItem.appendChild(document.createElement("span")).innerHTML =
|
||||||
" (" + descr + ")";
|
" (" + descr + ")";
|
||||||
else if (showSearchSummary)
|
else if (showSearchSummary)
|
||||||
fetch(requestUrl)
|
fetch(requestUrl)
|
||||||
@ -155,10 +155,8 @@ const Search = {
|
|||||||
_pulse_status: -1,
|
_pulse_status: -1,
|
||||||
|
|
||||||
htmlToText: (htmlString) => {
|
htmlToText: (htmlString) => {
|
||||||
const htmlElement = document
|
const htmlElement = new DOMParser().parseFromString(htmlString, 'text/html');
|
||||||
.createRange()
|
htmlElement.querySelectorAll(".headerlink").forEach((el) => { el.remove() });
|
||||||
.createContextualFragment(htmlString);
|
|
||||||
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;
|
||||||
console.warn(
|
console.warn(
|
||||||
@ -519,7 +517,7 @@ const Search = {
|
|||||||
|
|
||||||
let summary = document.createElement("p");
|
let summary = document.createElement("p");
|
||||||
summary.classList.add("context");
|
summary.classList.add("context");
|
||||||
summary.innerText = top + text.substr(startWithContext, 240).trim() + tail;
|
summary.textContent = top + text.substr(startWithContext, 240).trim() + tail;
|
||||||
|
|
||||||
highlightWords.forEach((highlightWord) =>
|
highlightWords.forEach((highlightWord) =>
|
||||||
_highlightText(summary, highlightWord, "highlighted")
|
_highlightText(summary, highlightWord, "highlighted")
|
||||||
|
Loading…
Reference in New Issue
Block a user