Skip to content

[BUG] Conditional Formatting with Font Style causes it to break styles on excel  #1583

@ywadi

Description

@ywadi

🐛 Bug Report

#1410
When an excel files has a conditional format defined, and the conditional formatting specifically has font styles to it, if you read it into exceljs and write it back with no changes, excel finds the styles corrupt and removes all styles

Lib version: Latest to date

Steps To Reproduce

Create an excel that has conditional formatting and has font styles for the conditional format.
Read the file by exceljs , do no changes, write it back to xlsx. The file results in a corrupted style and excel removes all styles.
Template with conditional formating font style
Same template without the font style in conditional format

node -e "const Excel = require('exceljs'); var workbook = new Excel.Workbook(); var data = workbook.xlsx.readFile('./template.xlsx').then(()=>workbook.xlsx.writeFile('./test.xlsx').then(()=>console.log('Finished writing')))"

The expected behaviour:

The file styles should not break if a conditional format has font styles.

Possible solution (optional, but very helpful):

Can not pinpoint where the issue is

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions