Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

fix: make reddit pipe write in markdown

Louis Beaumontdc76c9144357
diff --git a/examples/typescript/pipe-post-questions-on-reddit/pipe.ts b/examples/typescript/pipe-post-questions-on-reddit/pipe.ts
index 4d178eaa3..fe2ae8613 100644
--- a/examples/typescript/pipe-post-questions-on-reddit/pipe.ts
+++ b/examples/typescript/pipe-post-questions-on-reddit/pipe.ts
@@ -108,12 +108,12 @@ function generateRedditLinks(content: string): string {
const encodedTitle = encodeURIComponent(title);
const encodedBody = encodeURIComponent(`${title}\n\n${body}`);
- result += `[${index + 1}] ${title}\n\n${body}\n\n`;
+ result += `### ${index + 1}. ${title}\n\n${body}\n\n`;
subredditsMatch.forEach((subreddit) => {
const subredditName = subreddit.slice(2, -1);
const link = `https://www.reddit.com/r/${subredditName}/submit?title=${encodedTitle}&text=${encodedBody}`;
- result += `${subreddit} <a href="${link}">SEND</a>\n`;
+ result += `- ${subreddit} [SEND](${link})\n`;
});
result += "\n";
diff --git a/screenpipe-app-tauri/components/inbox-messages.tsx b/screenpipe-app-tauri/components/inbox-messages.tsx
index c602cdd82..502d10f30 100644
--- a/screenpipe-app-tauri/components/inbox-messages.tsx
+++ b/screenpipe-app-tauri/components/inbox-messages.tsx
@@ -173,23 +173,26 @@ export function InboxMessages({
<CardContent className="py-2">
<div className="w-full overflow-hidden">
<MemoizedReactMarkdown
- className="prose break-words dark:prose-invert prose-p:leading-relaxed prose-pre:p-0 w-[35vw] text-sm"
+ className="prose break-words dark:prose-invert prose-p:leading-relaxed prose-pre:p-0 w-[35vw] text-sm"
remarkPlugins={[remarkGfm, remarkMath]}
components={{
p: ({ children }) => (
<p className="mb-2 last:mb-0">{children}</p>
),
- a: ({ node, href, children, ...props }) => (
- <a
- href={href}
- target="_blank"
- rel="noopener noreferrer"
- className="break-all"
- {...props}
- >
- {children}
- </a>
- ),
+ a: ({ node, href, children, ...props }) => {
+ const isExternal = href?.startsWith('http') || href?.startsWith('https');
+ return (
+ <a
+ href={href}
+ target={isExternal ? "_blank" : undefined}
+ rel={isExternal ? "noopener noreferrer" : undefined}
+ className="break-all text-blue-500 hover:underline"
+ {...props}
+ >
+ {children}
+ </a>
+ );
+ },
}}
>
{expandedMessages.has(message.id)