Skip to content

Commit

Permalink
array literals not showing arraystop arrayrowstop
Browse files Browse the repository at this point in the history
  • Loading branch information
brainysmurf authored and joshbtn committed Mar 17, 2021
1 parent 6b9f778 commit 01987b8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/ExcelFormulaUtilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@


while (!EOF()) {

// state-dependent character evaluation (order is important)
// double-quoted strings
// embeds are doubled
Expand Down Expand Up @@ -783,6 +782,12 @@
case "ARRAYROW":
tokenString = formatStr(replaceTokenTmpl(options.tmplFunctionStartArrayRow), tokenString, indent, lineBreak);
break;
case "ARRAYSTOP":
tokenString = formatStr(replaceTokenTmpl(options.tmplFunctionStopArray), tokenString, indent, lineBreak);
break;
case "ARRAYROWSTOP":
tokenString = formatStr(replaceTokenTmpl(options.tmplFunctionStopArrayRow), tokenString, indent, lineBreak);
break;
default:
if (token.subtype.toString() === "start") {
tokenString = formatStr(replaceTokenTmpl(options.tmplFunctionStart), tokenString, indent, lineBreak);
Expand Down
9 changes: 9 additions & 0 deletions test/ExcelFormulaUtilities.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,13 @@ describe("ExcelFormulaUtilities", () => {
})
})

describe("#arrayliterals", () => {
it("Test parsing a formula that contains array literals. From Issue #89", () => {
let inputFormula='={A1:C2,B2:C3}';
let expected = '={&nbsp;A1:C2,<br /><span class="tabbed">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="tabbed">&nbsp;&nbsp;&nbsp;&nbsp;</span>B2:C3}';
let actual = formula.formatFormulaHTML(inputFormula);
assert.equal(actual, expected);
})
})

})

0 comments on commit 01987b8

Please sign in to comment.