Skip to content

Investigate what characters are valid for sheet name #2243

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

Closed
Siemienik opened this issue Apr 14, 2023 · 1 comment · Fixed by #2257
Closed

Investigate what characters are valid for sheet name #2243

Siemienik opened this issue Apr 14, 2023 · 1 comment · Fixed by #2257
Assignees

Comments

@Siemienik
Copy link
Member

Siemienik commented Apr 14, 2023

According to PR: #2126 (review). We will check what kind of characters can be put as the sheet's name.

@Siemienik
Copy link
Member Author

Siemienik commented Apr 18, 2023

There is valid all characters except '*', '?', ':', '/', '\\', '[', ']'. More precise rules:

  • name.length >= 1 (no blank names)
  • name.length < 32
  • !/[/\?:[]]/.test(name) (name cannot contain / \ ? * : [ ] ) - (add characters cannot be used for worksheet name #2126 has to be reverted*)
  • !name.startsWith("'") && !name.endsWith("'") (apostrophe cannot be first or last character)
  • name != "History"

@Siemienik Siemienik self-assigned this Apr 26, 2023
Siemienik added a commit that referenced this issue May 5, 2023
## Summary

This PR aims to resolve #2243 issue. 
Additionally, I transferred the responsibility for name validation from `Workbook` to `Worksheet`, which allowed me to tighten the rules for changing the name using: `ws.name`

## Test plan

I completed the missing tests and covers all new assertions.
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 a pull request may close this issue.

1 participant