您好,请参考以下临时解决方案:
var oldInit = GC.Spread.Formatter.GeneralFormatter.prototype.init;
GC.Spread.Formatter.GeneralFormatter.prototype.init = function () {
oldInit.apply(this, arguments);
var formatter = this.formatString();
var result = [], _count = 0, start = 0, len = formatter.length;
for (var i = 0; i < len; i++) {
if (formatter[i] === '_') {
_count++;
}
else {
if (formatter[i] === ';' && (_count === 0 || _count % 2 === 0)) {
result.push(formatter.substring(start, i));
start = i + 1;
}
_count = 0;
}
}
if (start <= len) {
result.push(formatter.substring(start, len));
}
result.forEach(function (item) {
if (item[item.length - 1] === "_") {
throw new Error("Format pattern is invalid");
}
})
} |