Explorar el Código

搜索结果有高亮字段优先使用

visuddhinanda hace 4 años
padre
commit
d29c9105cf
Se han modificado 1 ficheros con 9 adiciones y 2 borrados
  1. 9 2
      app/search/paliword.js

+ 9 - 2
app/search/paliword.js

@@ -96,9 +96,16 @@ function render_word_result(worddata) {
 		"&direction=col' target='_blank'>";
 		"&direction=col' target='_blank'>";
 	html += worddata.title + "</a></div>";
 	html += worddata.title + "</a></div>";
 
 
-	let newStr = highlightWords(worddata.palitext, keyword);
+	let highlightStr;
 
 
-	html += "<div class='wizard_par_div'>" + newStr + "</div>";
+	if(typeof worddata.highlight=="undefined"){
+		highlightStr= highlightWords(worddata.palitext, keyword);
+	}else{
+		highlightStr= worddata.highlight;
+	}
+	
+
+	html += "<div class='wizard_par_div'>" + highlightStr + "</div>";
 	html += "<div class='path'>" + worddata.path + "</div>";
 	html += "<div class='path'>" + worddata.path + "</div>";
 	html += "<div class='path'>" + worddata.book + "-" + worddata.para + "-" + worddata.wt + "</div>";
 	html += "<div class='path'>" + worddata.book + "-" + worddata.para + "-" + worddata.wt + "</div>";
 	html += "</div>";
 	html += "</div>";