From 2f2e9421f0661a0373b21dcadd66a3a4c725ca60 Mon Sep 17 00:00:00 2001 From: zhichaoxu Date: Mon, 20 Jun 2022 16:52:52 +0800 Subject: [PATCH] fix: cell data contains "<" sign 1. fix edit box and function box shows error data when cell value contains "<" and ">" sign. 2: fix copy paste data error when cell value contains "<", ">" sign. 3: add .vscode to gitignore fix #1060 --- .gitignore | 3 ++- src/controllers/selection.js | 2 ++ src/controllers/updateCell.js | 1 + src/global/formula.js | 9 +++++++++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index edfa44e..eecf1ec 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ docs/.vuepress/dist .idea .history -.vs \ No newline at end of file +.vs +.vscode \ No newline at end of file diff --git a/src/controllers/selection.js b/src/controllers/selection.js index af835bc..b464f45 100644 --- a/src/controllers/selection.js +++ b/src/controllers/selection.js @@ -467,6 +467,8 @@ const selection = { if(c_value == null){ c_value = ""; } + + c_value = formula.ltGtSignDeal(c_value) column += c_value; } diff --git a/src/controllers/updateCell.js b/src/controllers/updateCell.js index ad088dc..f9a947c 100644 --- a/src/controllers/updateCell.js +++ b/src/controllers/updateCell.js @@ -222,6 +222,7 @@ export function luckysheetupdateCell(row_index1, col_index1, d, cover, isnotfocu $("#luckysheet-rich-text-editor").html(""); } else{ + value = formula.ltGtSignDeal(value); $("#luckysheet-rich-text-editor").html(value); if (!isnotfocus) { luckysheetRangeLast($("#luckysheet-rich-text-editor")[0]); diff --git a/src/global/formula.js b/src/global/formula.js index cdb9d1d..8aa8901 100755 --- a/src/global/formula.js +++ b/src/global/formula.js @@ -325,6 +325,13 @@ const luckysheetformula = { if (typeof str !== 'string') return str; return str.replace(/