浏览代码

Use the original search text instead of the (maybe) escaped one, to
prevent issues with tables based on html

Dustin Utecht 4 年之前
父节点
当前提交
bc5da5208d
共有 1 个文件被更改,包括 2 次插入3 次删除
  1. 2 3
      src/bootstrap-table.js

+ 2 - 3
src/bootstrap-table.js

@@ -956,8 +956,7 @@ class BootstrapTable {
         return
       }
 
-      const s = this.searchText && (this.fromHtml ?
-        Utils.escapeHTML(this.searchText) : this.searchText).toLowerCase()
+      const s = this.searchText && (this.fromHtml ? Utils.escapeHTML(this.searchText) : this.searchText).toLowerCase()
       const f = Utils.isEmptyObject(this.filterColumns) ? null : this.filterColumns
 
       // Check filter
@@ -1041,7 +1040,7 @@ class BootstrapTable {
               }
             } else {
               const largerSmallerEqualsRegex = /(?:(<=|=>|=<|>=|>|<)(?:\s+)?(-?\d+)?|(-?\d+)?(\s+)?(<=|=>|=<|>=|>|<))/gm
-              const matches = largerSmallerEqualsRegex.exec(s)
+              const matches = largerSmallerEqualsRegex.exec(this.searchText)
               let comparisonCheck = false
 
               if (matches) {