mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-05-02 01:46:14 +00:00
Merge pull request #2156 from feitianbubu/pr/fix-tag-whitespace
fix: tag splitting by whitespace
This commit is contained in:
@@ -128,7 +128,7 @@ export const useModelPricingData = () => {
|
||||
if (!model.tags) return false;
|
||||
const tagsArr = model.tags
|
||||
.toLowerCase()
|
||||
.split(/[,;|\s]+/)
|
||||
.split(/[,;|]+/)
|
||||
.map((tag) => tag.trim())
|
||||
.filter(Boolean);
|
||||
return tagsArr.includes(tagLower);
|
||||
|
||||
@@ -23,7 +23,7 @@ import { useMemo } from 'react';
|
||||
const normalizeTags = (tags = '') =>
|
||||
tags
|
||||
.toLowerCase()
|
||||
.split(/[,;|\s]+/)
|
||||
.split(/[,;|]+/)
|
||||
.map((t) => t.trim())
|
||||
.filter(Boolean);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user