ソースを参照

Escape apostrophe manually

Dustin Utecht 2 年 前
コミット
8dac31e51c
1 ファイル変更6 行追加1 行削除
  1. 6 1
      src/utils/index.js

+ 6 - 1
src/utils/index.js

@@ -407,6 +407,11 @@ export default {
     return false
     return false
   },
   },
 
 
+  escapeApostrophe (value) {
+    return value.toString()
+      .replace(/'/g, ''')
+  },
+
   escapeHTML (text) {
   escapeHTML (text) {
     if (!text) {
     if (!text) {
       return text
       return text
@@ -524,7 +529,7 @@ export default {
 
 
         const field = columns[x].field
         const field = columns[x].field
 
 
-        row[field] = $el.html().trim()
+        row[field] = this.escapeApostrophe($el.html().trim())
         // save td's id, class and data-* attributes
         // save td's id, class and data-* attributes
         row[`_${field}_id`] = $el.attr('id')
         row[`_${field}_id`] = $el.attr('id')
         row[`_${field}_class`] = $el.attr('class')
         row[`_${field}_class`] = $el.attr('class')