Browse Source
Merge pull request #1061 from xu3927/dev
fix: cell data contains "<" sign
master
mengshukeji
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with
14 additions and
1 deletions
-
.gitignore
-
src/controllers/selection.js
-
src/controllers/updateCell.js
-
src/global/formula.js
|
@ -6,4 +6,5 @@ docs/.vuepress/dist |
|
|
|
|
|
|
|
|
.idea |
|
|
.idea |
|
|
.history |
|
|
.history |
|
|
.vs |
|
|
.vs |
|
|
|
|
|
.vscode |
|
@ -467,6 +467,8 @@ const selection = { |
|
|
if(c_value == null){ |
|
|
if(c_value == null){ |
|
|
c_value = ""; |
|
|
c_value = ""; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
c_value = formula.ltGtSignDeal(c_value) |
|
|
|
|
|
|
|
|
column += c_value; |
|
|
column += c_value; |
|
|
} |
|
|
} |
|
|
|
@ -222,6 +222,7 @@ export function luckysheetupdateCell(row_index1, col_index1, d, cover, isnotfocu |
|
|
$("#luckysheet-rich-text-editor").html(""); |
|
|
$("#luckysheet-rich-text-editor").html(""); |
|
|
} |
|
|
} |
|
|
else{ |
|
|
else{ |
|
|
|
|
|
value = formula.ltGtSignDeal(value); |
|
|
$("#luckysheet-rich-text-editor").html(value); |
|
|
$("#luckysheet-rich-text-editor").html(value); |
|
|
if (!isnotfocus) { |
|
|
if (!isnotfocus) { |
|
|
luckysheetRangeLast($("#luckysheet-rich-text-editor")[0]); |
|
|
luckysheetRangeLast($("#luckysheet-rich-text-editor")[0]); |
|
|
|
@ -325,6 +325,13 @@ const luckysheetformula = { |
|
|
if (typeof str !== 'string') return str; |
|
|
if (typeof str !== 'string') return str; |
|
|
return str.replace(/<script>/g, '<script>').replace(/<\/script>/, '</script>'); |
|
|
return str.replace(/<script>/g, '<script>').replace(/<\/script>/, '</script>'); |
|
|
}, |
|
|
}, |
|
|
|
|
|
ltGtSignDeal: function (str) { |
|
|
|
|
|
if (typeof str !== 'string') return str; |
|
|
|
|
|
if (str.substr(0, 5) === "<span" || str.startsWith('=')) { |
|
|
|
|
|
return str |
|
|
|
|
|
} |
|
|
|
|
|
return str.replace(/</g, '<').replace(/>/g, '>'); |
|
|
|
|
|
}, |
|
|
fucntionboxshow: function(r, c) { |
|
|
fucntionboxshow: function(r, c) { |
|
|
|
|
|
|
|
|
if (!checkProtectionCellHidden(r, c, Store.currentSheetIndex)) { |
|
|
if (!checkProtectionCellHidden(r, c, Store.currentSheetIndex)) { |
|
@ -3407,10 +3414,12 @@ const luckysheetformula = { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
else { |
|
|
else { |
|
|
|
|
|
value = _this.ltGtSignDeal(value); |
|
|
$copy.html(value); |
|
|
$copy.html(value); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
else { |
|
|
else { |
|
|
|
|
|
value = _this.ltGtSignDeal(value); |
|
|
$copy.html(value); |
|
|
$copy.html(value); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|