mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #8343 from janvojt/bug/unnecessary-load-of-images-in-search
Fix unnecessary load of images when parsing the document text for search function.
This commit is contained in:
commit
9957526256
@ -59,10 +59,10 @@ var Search = {
|
|||||||
_pulse_status : -1,
|
_pulse_status : -1,
|
||||||
|
|
||||||
htmlToText : function(htmlString) {
|
htmlToText : function(htmlString) {
|
||||||
var htmlElement = document.createElement('span');
|
var virtualDocument = document.implementation.createHTMLDocument('virtual');
|
||||||
htmlElement.innerHTML = htmlString;
|
var htmlElement = $(htmlString, virtualDocument);
|
||||||
$(htmlElement).find('.headerlink').remove();
|
htmlElement.find('.headerlink').remove();
|
||||||
docContent = $(htmlElement).find('[role=main]')[0];
|
docContent = htmlElement.find('[role=main]')[0];
|
||||||
if(docContent === undefined) {
|
if(docContent === undefined) {
|
||||||
console.warn("Content block not found. Sphinx search tries to obtain it " +
|
console.warn("Content block not found. Sphinx search tries to obtain it " +
|
||||||
"via '[role=main]'. Could you check your theme or template.");
|
"via '[role=main]'. Could you check your theme or template.");
|
||||||
|
Loading…
Reference in New Issue
Block a user