aboutsummaryrefslogtreecommitdiffstats
path: root/apps/workers
diff options
context:
space:
mode:
Diffstat (limited to 'apps/workers')
-rw-r--r--apps/workers/openaiWorker.ts8
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/workers/openaiWorker.ts b/apps/workers/openaiWorker.ts
index 697c9c53..7b74e4c3 100644
--- a/apps/workers/openaiWorker.ts
+++ b/apps/workers/openaiWorker.ts
@@ -257,11 +257,13 @@ async function inferTags(
);
// Sometimes the tags contain the hashtag symbol, let's strip them out if they do.
+ // Additionally, trim the tags to prevent whitespaces at the beginning/the end of the tag.
tags = tags.map((t) => {
- if (t.startsWith("#")) {
- return t.slice(1);
+ let tag = t;
+ if (tag.startsWith("#")) {
+ tag = t.slice(1);
}
- return t;
+ return tag.trim();
});
return tags;