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