Skip to content

Commit

Permalink
[FIX] export: remove line returns in formula
Browse files Browse the repository at this point in the history
before this commit, the exported formulas contained line returns. It woudn't show properly in google sheet.

after this commit, the line returns have been removedd

Task: 3618912
Part-of: #3566
  • Loading branch information
VincentSchippefilt committed Jan 30, 2024
1 parent 04d1be4 commit f63d893
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
7 changes: 1 addition & 6 deletions src/xlsx/functions/cells.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,7 @@ export function addFormula(cell: ExcelCellData): {
attrs.push(["t", "str"]);
cycle = escapeXml/*xml*/ `<v>${cell.value}</v>`;
}
node = escapeXml/*xml*/ `
<f>
${XlsxFormula}
</f>
${cycle}
`;
node = escapeXml/*xml*/ `<f> ${XlsxFormula} </f> ${cycle}`;
return { attrs, node };
} else {
// Shouldn't we always output the value then ?
Expand Down
9 changes: 4 additions & 5 deletions src/xlsx/functions/worksheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,10 @@ export function addRows(
));
}
attributes.push(...additionalAttrs);
cellNodes.push(escapeXml/*xml*/ `
<c ${formatAttributes(attributes)}>
${cellNode}
</c>
`);
// prettier-ignore
cellNodes.push(escapeXml/*xml*/ `<c ${formatAttributes(attributes)}>
${cellNode}
</c>`);
}
}
if (cellNodes.length || row.size !== DEFAULT_CELL_HEIGHT || row.isHidden) {
Expand Down

0 comments on commit f63d893

Please sign in to comment.