Skip to content

Commit

Permalink
fix: only change the style when have ts (#4365)
Browse files Browse the repository at this point in the history
  • Loading branch information
ybzky authored Dec 25, 2024
1 parent a58c181 commit 57467da
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export function generateParagraphs(dataStream: string, prevParagraph?: IParagrap
export function convertToCellStyle(cell: ICellDataWithSpanInfo, dataStream: string, textRuns: ITextRun[] | undefined) {
const dataStreamLength = dataStream.length;
const textRunsLength = textRuns?.length ?? 0;
const canConvertToCellStyle = !textRunsLength || (textRunsLength === 1 && textRuns![0].st === 0 && textRuns![0].ed === dataStreamLength);
const canConvertToCellStyle = textRunsLength === 1 && textRuns![0].st === 0 && textRuns![0].ed === dataStreamLength;

if (cell.p) {
if (canConvertToCellStyle && cell.p.body?.textRuns?.length) {
Expand Down

0 comments on commit 57467da

Please sign in to comment.