lowercase tags effect marker color

This commit is contained in:
Anton 2023-07-22 07:28:50 +02:00
parent b1093dcc41
commit 846dea24db
2 changed files with 2 additions and 1 deletions

View File

@ -31,7 +31,7 @@ export const Layer = (props: LayerProps) => {
const getTags = (item: Item) => {
console.log(item.text);
const regex = /(^|\B)#(?![0-9_]+\b)([a-zA-Z0-9_]{1,30})(\b|\r)/g;
const strings = item.text.match(regex);
const strings = item.text.toLocaleLowerCase().match(regex);
console.log(strings);
const tags: Tag[] = [];
strings?.map(tag => {

View File

@ -7,6 +7,7 @@ export function Tags({data} : {data: Tag[]}) {
const addTag = useAddTag();
useEffect(() => {
data.map(tag => {
tag.id = tag.id.toLocaleLowerCase();
addTag(tag)
})
}, [addTag, data])