bloby-bot 0.24.3 → 0.24.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bloby-bot",
3
- "version": "0.24.3",
3
+ "version": "0.24.4",
4
4
  "releaseNotes": [
5
5
  "1. new stuff",
6
6
  "2. ",
@@ -29,11 +29,17 @@ function formatTime(iso: string): string {
29
29
  }
30
30
  }
31
31
 
32
- /** Convert backtick-wrapped WhatsApp QR URL into a markdown link */
32
+ /** Convert WhatsApp QR URL (any format) into a markdown link so the button renders */
33
33
  function preprocessContent(text: string): string {
34
+ const link = '[pair-whatsapp](/api/channels/whatsapp/qr-page)';
35
+ // Already a properly formatted markdown link — skip
36
+ if (text.includes(link)) return text;
37
+ // Backtick-wrapped full URL: `http://localhost:7400/api/channels/whatsapp/qr-page`
38
+ // Full URL in plain text: http://localhost:7400/api/channels/whatsapp/qr-page
39
+ // Bare relative path: /api/channels/whatsapp/qr-page
34
40
  return text.replace(
35
- /`http:\/\/localhost:\d+\/api\/channels\/whatsapp\/qr-page`/g,
36
- '[pair-whatsapp](/api/channels/whatsapp/qr-page)'
41
+ /`?(?:http:\/\/localhost:\d+)?\/api\/channels\/whatsapp\/qr-page`?/g,
42
+ link,
37
43
  );
38
44
  }
39
45