Skip to content

Commit

Permalink
🐛 encode chinese chars in permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
StarHeartHunt committed Sep 11, 2024
1 parent bcba6a0 commit c219d2a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/plugin-changelog/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ function getPaginator(chunks: Section[][], prevIdx: number, nextIdx: number) {
if (prevIdx >= 0 && prevIdx < chunks.length) {
const chunk = chunks?.[prevIdx]?.[0];
if (chunk) {
content += ` previous={{ title: "${chunk.title}", permalink: "/changelog/${chunk.title}" }}`;
content += ` previous={{ title: "${chunk.title}", permalink: "/changelog/${encodeURIComponent(chunk.title)}" }}`;
}
}

if (nextIdx >= 0 && nextIdx < chunks.length) {
const chunk = chunks?.[nextIdx]?.[0];
if (chunk) {
content += ` next={{ title: "${chunk.title}", permalink: "/changelog/${chunk.title}" }}`;
content += ` next={{ title: "${chunk.title}", permalink: "/changelog/${encodeURIComponent(chunk.title)}" }}`;
}
}

Expand Down

0 comments on commit c219d2a

Please # to comment.