Skip to content

Let's use AI to Earn!

fix: 解决了小红书个别话题不生效的问题

gaoSir156e7a8d4a3b
diff --git a/src/icp/publish.ts b/src/icp/publish.ts
index 5189f506..513a5ebd 100644
--- a/src/icp/publish.ts
+++ b/src/icp/publish.ts
@@ -47,7 +47,6 @@ export async function icpCreatePubRecord(pubRecord: Partial<PubRecordModel>) {
* @param pubRecord
*/
export async function icpCreateVideoPubRecord(pubRecord: Partial<VideoPul>) {
- console.log(pubRecord);
const { topics, cleanedString } = parseTopicString(pubRecord.desc || '');
pubRecord.topics = [...new Set(pubRecord.topics?.concat(topics))];
pubRecord.desc = cleanedString;
diff --git a/src/utils/index.ts b/src/utils/index.ts
index 6ada15f7..1f394b3f 100644
--- a/src/utils/index.ts
+++ b/src/utils/index.ts
@@ -67,7 +67,7 @@ export function parseTopicString(input: string): {
cleanedString: string;
} {
// 使用正则表达式提取字符串中的部分
- const extractedParts = input.match(/#(\S+)\s/g) || [];
+ const extractedParts = input.match(/#(\S+)/g) || [];
// 在原始输入中用空字符串替换提取的部分
let cleanedString = input;
@@ -77,7 +77,7 @@ export function parseTopicString(input: string): {
// 创建提取的话题数组
const topics = extractedParts.map((part) => {
- const match = part.match(/#(\S+)\s/);
+ const match = part.match(/#(\S+)/);
return match ? match[1] : '';
});