mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #9495 from tk0miya/9456_abbr_marks_on_search_result
Fix #9456: html search: abbreation marks are inserted to the search
This commit is contained in:
commit
efea26f7d1
2
CHANGES
2
CHANGES
@ -28,6 +28,8 @@ Bugs fixed
|
||||
* #9481: autosummary: some warnings contain non-existing filenames
|
||||
* #9481: c domain: some warnings contain non-existing filenames
|
||||
* #9481: cpp domain: some warnings contain non-existing filenames
|
||||
* #9456: html search: abbreation marks are inserted to the search result if
|
||||
failed to fetch the content of the page
|
||||
|
||||
Testing
|
||||
--------
|
||||
|
@ -282,7 +282,10 @@ var Search = {
|
||||
complete: function(jqxhr, textstatus) {
|
||||
var data = jqxhr.responseText;
|
||||
if (data !== '' && data !== undefined) {
|
||||
listItem.append(Search.makeSearchSummary(data, searchterms, hlterms));
|
||||
var summary = Search.makeSearchSummary(data, searchterms, hlterms);
|
||||
if (summary) {
|
||||
listItem.append(summary);
|
||||
}
|
||||
}
|
||||
Search.output.append(listItem);
|
||||
setTimeout(function() {
|
||||
@ -498,6 +501,9 @@ var Search = {
|
||||
*/
|
||||
makeSearchSummary : function(htmlText, keywords, hlwords) {
|
||||
var text = Search.htmlToText(htmlText);
|
||||
if (text == "") {
|
||||
return null;
|
||||
}
|
||||
var textLower = text.toLowerCase();
|
||||
var start = 0;
|
||||
$.each(keywords, function() {
|
||||
|
Loading…
Reference in New Issue
Block a user