|
@@ -288,10 +288,12 @@ function writeSharedString(sharedStrList){
|
|
|
rst.push(dftHeadXml + '\r\n');
|
|
|
rst.push('<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="' + sharedStrList.length + '" uniqueCount="' + sharedStrList.length + '">');
|
|
|
let regExp = new RegExp("<", "gm");
|
|
|
+ let regExp1 = new RegExp(">", "gm");
|
|
|
+ let regExp2 = new RegExp("&", "gm");
|
|
|
for (let i = 0; i < sharedStrList.length; i++) {
|
|
|
if (typeof sharedStrList[i] === 'string') {
|
|
|
//转换特殊字符,如 < , 则需要转义一下
|
|
|
- sharedStrList[i] = sharedStrList[i].replace(regExp, "<");
|
|
|
+ sharedStrList[i] = sharedStrList[i].replace(regExp, "<").replace(regExp1, '>').replace(regExp2, '&');
|
|
|
if (sharedStrList[i].indexOf('|') >= 0) {
|
|
|
//rst.push('<si><t>' + sharedStrList[i].split('|').join('\r\n') + '</t></si>');
|
|
|
// rst.push('<si><t>' + sharedStrList[i].split('|').join('\n') + '</t></si>');
|