fix: hashtag extraction and make remote links absolute
This commit is contained in:
@@ -20,9 +20,12 @@ export function extractHashTags(inputString: string) {
|
||||
const hashtags = [];
|
||||
|
||||
for (
|
||||
const [hashtag] of inputString.matchAll(/(?<!\()\B(\#[a-zA-Z\-]+\b)(?!;)/g)
|
||||
const [hashtag] of inputString.matchAll(/(?:^|\s)#\S*(?<!\))/g)
|
||||
) {
|
||||
hashtags.push(hashtag.replace(/\#/g, ""));
|
||||
const cleaned = hashtag.replace(/\#/g, "").trim();
|
||||
if (cleaned.length > 2) {
|
||||
hashtags.push(cleaned);
|
||||
}
|
||||
}
|
||||
|
||||
return hashtags;
|
||||
|
||||
Reference in New Issue
Block a user