Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed the problem of generating wrong formula caused by RemoveCol #1880

Merged
merged 3 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions datavalidation.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,13 @@ var (
`&`, `&`,
`<`, `&lt;`,
`>`, `&gt;`,
`"`, "&quot;",
)
formulaUnescaper = strings.NewReplacer(
`&amp;`, `&`,
`&lt;`, `<`,
`&gt;`, `>`,
"&quot;", `"`,
)
// dataValidationTypeMap defined supported data validation types.
dataValidationTypeMap = map[DataValidationType]string{
Expand Down
2 changes: 1 addition & 1 deletion datavalidation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func TestDataValidation(t *testing.T) {
assert.NotEqual(t, "", dv.Formula1,
"Formula1 should not be empty for valid input %v", listValid)
}
assert.Equal(t, `"A&lt;,B&gt;,C"",D ,E',F"`, dv.Formula1)
assert.Equal(t, `"A&lt;,B&gt;,C&quot;,D ,E',F"`, dv.Formula1)
xuri marked this conversation as resolved.
Show resolved Hide resolved
assert.NoError(t, f.AddDataValidation("Sheet1", dv))

dataValidations, err = f.GetDataValidations("Sheet1")
Expand Down
Loading