fix wrongly replacing text in shared strings

This commit is contained in:
Steven
2018-08-09 10:28:46 +02:00
parent bd302ea9dc
commit e732f9c743
2 changed files with 7 additions and 8 deletions
+1 -2
View File
@@ -770,8 +770,7 @@ module.exports = (function() {
} else {
var newString = string.replace(placeholder.placeholder, self.stringify(substitution));
cell.attrib.t = "s";
self.replaceString(string, newString);
return newString;
return self.insertCellValue(cell, newString)
}
};
+6 -6
View File
@@ -638,8 +638,8 @@ describe("Helpers", function() {
t.addSharedString(string);
buster.expect(t.substituteScalar(col, string, placeholder, substitution)).toEqual("foo: bar");
buster.expect(col.attrib.t).toEqual("s");
buster.expect(val.text).toEqual("0");
buster.expect(t.sharedStrings).toEqual(["foo: bar"]);
buster.expect(val.text).toEqual("1");
buster.expect(t.sharedStrings).toEqual(["foo: ${foo}", "foo: bar"]);
});
it("can substitute parts of strings with booleans", function() {
@@ -666,8 +666,8 @@ describe("Helpers", function() {
t.addSharedString(string);
buster.expect(t.substituteScalar(col, string, placeholder, substitution)).toEqual("foo: 0");
buster.expect(col.attrib.t).toEqual("s");
buster.expect(val.text).toEqual("0");
buster.expect(t.sharedStrings).toEqual(["foo: 0"]);
buster.expect(val.text).toEqual("1");
buster.expect(t.sharedStrings).toEqual(["foo: ${foo}", "foo: 0"]);
});
it("can substitute parts of strings with numbers", function() {
@@ -694,8 +694,8 @@ describe("Helpers", function() {
t.addSharedString(string);
buster.expect(t.substituteScalar(col, string, placeholder, substitution)).toEqual("foo: 10");
buster.expect(col.attrib.t).toEqual("s");
buster.expect(val.text).toEqual("0");
buster.expect(t.sharedStrings).toEqual(["foo: 10"]);
buster.expect(val.text).toEqual("1");
buster.expect(t.sharedStrings).toEqual(["foo: ${foo}", "foo: 10"]);
});