-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add support for threads #46
Conversation
You use term "tweet" on your changes but we should use "post" it's the word use everywhere |
@@ -20,15 +21,25 @@ if (Object.hasOwn(request, 'richTextFile')) { | |||
richTextFile = path.resolve(path.dirname(requestFilePath), request.richTextFile); | |||
request.richText = fs.readFileSync(richTextFile, 'utf-8'); | |||
} | |||
const threadElements = request.action !== 'repost' && request.richText?.split(/\n+ {0,3}([-_*])[ \t]*(?:\1[ \t]*){2,}\n+/g); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel that at some point, it would be good to include a proper markdown parser - for example, we can support alternative link text, which is not currently supported in bluesky UI, but supported in their API (the hacker news bot uses this extensively https://bsky.app/profile/newsycombinator.bsky.social), and we can support that too with markdown link syntax, which is a nice-to-have.
replyURL: REPLY_IN_THREAD, | ||
}), | ||
richText, | ||
})) : [request]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel this would be a lot more readable if it's just if-else blocks instead of lots of ternary branches, it kills way more brain cells than it deserves to understand this expression...
Fixes: #37
(tested with TestOrgPleaseIgnore@98427a5)