@timpel/forumkit-sdk-react-native 0.2.8 → 0.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2592,8 +2592,10 @@ function ComposerOverlay({ onClose, onOpenDrafts, onPosted, initialDraft }) {
2592
2592
  if (!token || !canPost) return;
2593
2593
  setSubmitting(true);
2594
2594
  setError(null);
2595
- const rawBody = tab === "link" ? body.trim() ? `${body.trim()}
2596
- ${linkUrl.trim()}` : linkUrl.trim() : body;
2595
+ const hasLink = linkTrimmed.length > 0 && isValidUrl(linkTrimmed);
2596
+ const linkMarkdown = hasLink ? `[${linkTrimmed}](${linkTrimmed})` : "";
2597
+ const rawBody = hasLink ? body.trim() ? `${body.trim()}
2598
+ ${linkMarkdown}` : linkMarkdown : body;
2597
2599
  const postBody = rawBody.trim().length > 0 ? rawBody : " ";
2598
2600
  try {
2599
2601
  const thread = await createThread(apiUrl, forumId, {