#tags not case sensitive

This commit is contained in:
Anton 2023-07-21 23:28:57 +02:00
parent bd57c87e95
commit cf34e815b6

View File

@ -10,7 +10,7 @@ export function heighlightTags(message: string, tags: Tag[]): string {
message = message.replace(hashTagRegex, function (string) {
console.log(string);
const tag = tags.find(t => t.id == string.slice(1))
const tag = tags.find(t => t.id.toLowerCase() == string.slice(1).toLowerCase())
return `<span style="background-color: ${tag ? tag.color : '#aaa' };padding: 0px 5px;border-radius: 7px;cursor: pointer;color:#fff">` + string + '</span>'
});