Skip to content

Commit

Permalink
fix: avoid converting non-first letter items to lowercase when using …
Browse files Browse the repository at this point in the history
…`capitalizeEachWords`
  • Loading branch information
jooy2 committed Sep 3, 2024
1 parent 40a2ee3 commit 6f639a0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## 1.25.1 (2024-)

- **BREAKING CHANGES**: The `Options` type for TypeScript has been renamed to `VitePressSidebarOptions`.
- Fix to avoid converting non-first letter items to lowercase when using `capitalizeEachWords`
- Support for specifying sidebar option types for TypeScript
- Korean documentation support

Expand Down
2 changes: 1 addition & 1 deletion lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ export default class VitePressSidebar {
}

if (options.capitalizeEachWords) {
const splitStr = result.trim().toLowerCase().split(' ');
const splitStr = result.trim().split(' ');

for (let i = 0; i < splitStr.length; i += 1) {
splitStr[i] = VitePressSidebar.capitalizeFirst(splitStr[i]);
Expand Down
2 changes: 1 addition & 1 deletion test/specs/apis.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1228,7 +1228,7 @@ describe('Test: APIs', () => {
link: '/folder/folder-test'
},
{
text: 'Subfolder',
text: 'SubFolder',
items: [
{
text: 'Sub Folder Test',
Expand Down

0 comments on commit 6f639a0

Please sign in to comment.