Skip to content

Commit f6b32a6

Browse files
committed
fix: tag splitting by whitespace
1 parent 00782aa commit f6b32a6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

web/src/components/table/model-pricing/filter/PricingTags.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const PricingTags = ({
4444
(allModels.length > 0 ? allModels : models).forEach((model) => {
4545
if (model.tags) {
4646
model.tags
47-
.split(/[,;|\s]+/) // 逗号、分号、竖线或空白字符
47+
.split(/[,;|]+/) // 逗号、分号或竖线(保留空格,允许多词标签如 "open weights")
4848
.map((tag) => tag.trim())
4949
.filter(Boolean)
5050
.forEach((tag) => tagSet.add(tag.toLowerCase()));
@@ -64,7 +64,7 @@ const PricingTags = ({
6464
if (!model.tags) return false;
6565
return model.tags
6666
.toLowerCase()
67-
.split(/[,;|\s]+/)
67+
.split(/[,;|]+/)
6868
.map((tg) => tg.trim())
6969
.includes(tagLower);
7070
}).length;

web/src/hooks/model-pricing/useModelPricingData.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export const useModelPricingData = () => {
128128
if (!model.tags) return false;
129129
const tagsArr = model.tags
130130
.toLowerCase()
131-
.split(/[,;|\s]+/)
131+
.split(/[,;|]+/)
132132
.map((tag) => tag.trim())
133133
.filter(Boolean);
134134
return tagsArr.includes(tagLower);

0 commit comments

Comments
 (0)