diff --git a/src/controllers/postil.js b/src/controllers/postil.js index 6c260dc28..2dcb0c95b 100644 --- a/src/controllers/postil.js +++ b/src/controllers/postil.js @@ -229,7 +229,7 @@ const luckysheetPostil = { let html = '
' + '' + - '
'+ value +'
' + + '
'+ _this.htmlEscape(value) +'
' + '
'; $(html).appendTo($("#luckysheet-cell-main")); @@ -392,7 +392,7 @@ const luckysheetPostil = { '' + '
' + '
' + - value + + _this.htmlEscape(value) + '
' + '
' + '' + @@ -564,7 +564,7 @@ const luckysheetPostil = { '' + '
' + '
' + - value + + _this.htmlEscape(value) + '
' + '
' + '' + @@ -686,7 +686,7 @@ const luckysheetPostil = { '' + '
' + '
' + - value + + _this.htmlEscape(value) + '
' + '
' + '' + @@ -810,7 +810,7 @@ const luckysheetPostil = { '' + '
' + '
' + - value + + _this.htmlEscape(value) + '
' + '
' + '' + @@ -924,6 +924,25 @@ const luckysheetPostil = { $("#" + id).hide(); } }); + }, + htmlEscape: function(text){ + return text.replace(/[<>"&]/g, function(match, pos, originalText){ + console.log(match, pos, originalText) + switch(match){ + case '<': { + return '<'; + } + case '>': { + return '>'; + } + case '&': { + return '&'; + } + case '\"': { + return '"'; + } + } + }) } } diff --git a/src/controllers/sheetmanage.js b/src/controllers/sheetmanage.js index ec4536c41..2f571ed81 100644 --- a/src/controllers/sheetmanage.js +++ b/src/controllers/sheetmanage.js @@ -942,6 +942,7 @@ const sheetmanage = { storeSheetParam: function() { let index = this.getSheetIndex(Store.currentSheetIndex); let file = Store.luckysheetfile[index]; + file["config"] = Store.config; file["visibledatarow"] = Store.visibledatarow; file["visibledatacolumn"] = Store.visibledatacolumn; file["ch_width"] = Store.ch_width;