Skip to content

Escape conditional formatting expressions in worksheet XML - #643

Open
JimmyLiuJia wants to merge 1 commit into
dhatim:masterfrom
JimmyLiuJia:codex/fix-conditional-formatting-expression-xml
Open

JimmyLiuJia wants to merge 1 commit into
dhatim:masterfrom
JimmyLiuJia:codex/fix-conditional-formatting-expression-xml

Conversation

@JimmyLiuJia

Copy link
Copy Markdown

Fixes #563.

ConditionalFormattingExpressionRule wrote formulas directly into worksheet XML. Expressions containing < or & could make the workbook invalid. Serialize the formula with the existing Writer.appendEscaped method, preserving the caller's expression.

The regression writes IF(A1<5,A1&"x",""), reopens the workbook with Apache POI, and checks that the formula round-trips unchanged.

Validation: mvn -pl fastexcel-writer test passed (113 tests, 0 failures, 0 errors) on Java 17. The focused PoiCompatibilityTest passed all 26 tests.

AI assistance was used to investigate, implement, test, and draft this PR.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ConditionalFormattingExpressionRule expression should be escaped

2 participants