Skip to content

Commit

Permalink
data.tags.split fix
Browse files Browse the repository at this point in the history
  • Loading branch information
youliao committed Jul 11, 2022
1 parent 9b4a474 commit 1611ca8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/structures/Post.ts
Expand Up @@ -80,11 +80,14 @@ function getTags(data: any): string[] {
)
} else if (data.tags) {
tags = data.tags.split(' ')
} else {
} else if(data.tag_string){
tags = data.tag_string
.split(' ')
.map((v: string): string => v.replace(/,/g, '').replace(/ /g, '_'))
}
else{
return [];
}

return tags.filter((v: string) => v !== '')
}
Expand Down

0 comments on commit 1611ca8

Please sign in to comment.