Browse Source

搜索增加突出显示

hejq 7 years ago
parent
commit
dde901ea22
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/main/webapp/resources/js/common/base.js

+ 3 - 0
src/main/webapp/resources/js/common/base.js

@@ -98,6 +98,9 @@ function highlight(text, words, tag) {
  * @returns {*}
  * @returns {*}
  */
  */
 function highLightKeywords(text, words, tag) {
 function highLightKeywords(text, words, tag) {
+    if (isEmpty(words)) {
+        return text;
+    }
     // 默认的标签,如果没有指定,使用span
     // 默认的标签,如果没有指定,使用span
     tag = tag || 'span';
     tag = tag || 'span';