fix: Trim whitespace from category and tag names in URL generation (#437)
This commit is contained in:
committed by
GitHub
parent
7f0c109b17
commit
2b3d7cf304
@@ -67,9 +67,13 @@ export async function getCategoryList(): Promise<Category[]> {
|
||||
count[ucKey] = count[ucKey] ? count[ucKey] + 1 : 1;
|
||||
return;
|
||||
}
|
||||
count[post.data.category] = count[post.data.category]
|
||||
? count[post.data.category] + 1
|
||||
: 1;
|
||||
|
||||
const categoryName =
|
||||
typeof post.data.category === "string"
|
||||
? post.data.category.trim()
|
||||
: String(post.data.category).trim();
|
||||
|
||||
count[categoryName] = count[categoryName] ? count[categoryName] + 1 : 1;
|
||||
});
|
||||
|
||||
const lst = Object.keys(count).sort((a, b) => {
|
||||
|
||||
Reference in New Issue
Block a user