Summary
Adopt upstream PR exceljs#2851 to fix parsing of boolean XML attributes with explicit val="0".
Currently, the code doesn't handle <strike val="0"/> correctly - it always sets the model to true. This fix properly checks the val attribute and sets model to false when val="0".
Upstream PR
Changes
File modified:
lib/xlsx/xform/simple/boolean-xform.js - Fix parseOpen to check val attribute (1 line)
Total: 1 addition, 1 deletion
Bug Description
When reading Excel files with strike-through formatting that is explicitly disabled (<strike val="0"/>), the parser incorrectly interprets it as strike-through enabled.
Current behavior:
parseOpen(node) {
if (node.name === this.tag) {
this.model = true; // Always true!
}
}
Fixed behavior:
parseOpen(node) {
if (node.name === this.tag) {
this.model = node.attributes.val !== "0"; // Respects val attribute
}
}
Value Proposition
- Low Risk - Single line change in boolean parsing
- Bug Fix - Corrects incorrect parsing behavior
- Standards Compliant - Properly handles OOXML boolean attributes
Testing Plan
Summary
Adopt upstream PR exceljs#2851 to fix parsing of boolean XML attributes with explicit val="0".
Currently, the code doesn't handle
<strike val="0"/>correctly - it always sets the model to true. This fix properly checks the val attribute and sets model to false when val="0".Upstream PR
Changes
File modified:
lib/xlsx/xform/simple/boolean-xform.js- Fix parseOpen to check val attribute (1 line)Total: 1 addition, 1 deletion
Bug Description
When reading Excel files with strike-through formatting that is explicitly disabled (
<strike val="0"/>), the parser incorrectly interprets it as strike-through enabled.Current behavior:
Fixed behavior:
Value Proposition
Testing Plan