9b395f5cc3
E2E Headed Chrome / e2e-headed (macos-15) (push) Has been cancelled
E2E Headed Chrome / e2e-headed (ubuntu-latest) (push) Has been cancelled
E2E Headed Chrome / e2e-headed (windows-latest) (push) Has been cancelled
CI / build (macos-latest) (push) Has been cancelled
CI / build (ubuntu-latest) (push) Has been cancelled
CI / build (windows-latest) (push) Has been cancelled
CI / unit-test (push) Has been cancelled
CI / bun-test (push) Has been cancelled
CI / adapter-test (push) Has been cancelled
CI / smoke-test (macos-latest) (push) Has been cancelled
CI / smoke-test (ubuntu-latest) (push) Has been cancelled
Security Audit / audit (push) Has been cancelled
Build Chrome Extension / build (push) Has been cancelled
Trigger Website Rebuild (Docs Updated) / dispatch (push) Has been cancelled
16 lines
456 B
JavaScript
16 lines
456 B
JavaScript
export function parseTextExtra(_text, hashtags) {
|
|
return hashtags.map((h) => ({
|
|
type: 1,
|
|
hashtag_id: h.id,
|
|
hashtag_name: h.name,
|
|
start: h.start,
|
|
end: h.end,
|
|
caption_start: 0,
|
|
caption_end: h.end - h.start,
|
|
}));
|
|
}
|
|
/** Extract hashtag names from text (e.g. "#话题" → ["话题"]) */
|
|
export function extractHashtagNames(text) {
|
|
return [...text.matchAll(/#([^\s#]+)/g)].map((m) => m[1]);
|
|
}
|