@hivegpt/hiveai-angular 0.0.56 → 0.0.57

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.
@@ -1266,46 +1266,35 @@
1266
1266
  };
1267
1267
  // events/${eventId}/users-connections
1268
1268
  ChatDrawerComponent.prototype.simpleMarkdownParser = function (markdownContent) {
1269
- return __awaiter(this, void 0, void 0, function () {
1270
- var markdown, html;
1271
- return __generator(this, function (_e) {
1272
- markdown = String(markdownContent);
1273
- html = markdown.replace(/^###### (.*$)/gim, '<h6>$1</h6>');
1274
- html = html.replace(/^##### (.*$)/gim, '<h5>$1</h5>');
1275
- html = html.replace(/^#### (.*$)/gim, '<h4>$1</h4>');
1276
- html = html.replace(/^### (.*$)/gim, '<h3>$1</h3>');
1277
- html = html.replace(/^## (.*$)/gim, '<h2>$1</h2>');
1278
- html = html.replace(/^# (.*$)/gim, '<h1>$1</h1>');
1279
- // Convert bold and italic
1280
- html = html.replace(/\*\*\*(.*?)\*\*\*/gim, '<em><strong>$1</strong></em>');
1281
- html = html.replace(/\*\*(.*?)\*\*/gim, '<strong>$1</strong>');
1282
- html = html.replace(/\*(.*?)\*/gim, '<em>$1</em>');
1283
- // Convert links
1284
- html = html.replace(/\[(.*?)\]\((.*?)\)/gim, '<a href="$2">$1</a>');
1285
- // Convert unordered lists
1286
- html = html.replace(/^\* (.*)/gim, '<ul><li>$1</li></ul>');
1287
- html = html.replace(/^\- (.*)/gim, '<ul><li>$1</li></ul>');
1288
- html = html.replace(/^\+ (.*)/gim, '<ul><li>$1</li></ul>');
1289
- // Convert ordered lists
1290
- html = html.replace(/^\d+\. (.*)/gim, '<ol><li>$1</li></ol>');
1291
- // Convert line breaks
1292
- html = html.replace(/\n/gim, '<br/>');
1293
- return [2 /*return*/, html.trim()];
1294
- });
1295
- });
1269
+ // Ensure markdownContent is a string
1270
+ var markdown = String(markdownContent);
1271
+ // Convert headings
1272
+ var html = markdown.replace(/^###### (.*$)/gim, '<h6>$1</h6>');
1273
+ html = html.replace(/^##### (.*$)/gim, '<h5>$1</h5>');
1274
+ html = html.replace(/^#### (.*$)/gim, '<h4>$1</h4>');
1275
+ html = html.replace(/^### (.*$)/gim, '<h3>$1</h3>');
1276
+ html = html.replace(/^## (.*$)/gim, '<h2>$1</h2>');
1277
+ html = html.replace(/^# (.*$)/gim, '<h1>$1</h1>');
1278
+ // Convert bold and italic
1279
+ html = html.replace(/\*\*\*(.*?)\*\*\*/gim, '<em><strong>$1</strong></em>');
1280
+ html = html.replace(/\*\*(.*?)\*\*/gim, '<strong>$1</strong>');
1281
+ html = html.replace(/\*(.*?)\*/gim, '<em>$1</em>');
1282
+ // Convert links
1283
+ html = html.replace(/\[(.*?)\]\((.*?)\)/gim, '<a href="$2">$1</a>');
1284
+ // Convert unordered lists
1285
+ html = html.replace(/^\* (.*)/gim, '<ul><li>$1</li></ul>');
1286
+ html = html.replace(/^\- (.*)/gim, '<ul><li>$1</li></ul>');
1287
+ html = html.replace(/^\+ (.*)/gim, '<ul><li>$1</li></ul>');
1288
+ // Convert ordered lists
1289
+ html = html.replace(/^\d+\. (.*)/gim, '<ol><li>$1</li></ol>');
1290
+ // Convert line breaks
1291
+ html = html.replace(/\n/gim, '<br/>');
1292
+ return html.trim();
1296
1293
  };
1297
1294
  ChatDrawerComponent.prototype.handleMarkdown = function (markdownContent) {
1298
- return __awaiter(this, void 0, void 0, function () {
1299
- var safeHtml, htmlContent;
1300
- return __generator(this, function (_e) {
1301
- switch (_e.label) {
1302
- case 0: return [4 /*yield*/, this.simpleMarkdownParser(markdownContent)];
1303
- case 1:
1304
- htmlContent = _e.sent();
1305
- return [2 /*return*/, htmlContent];
1306
- }
1307
- });
1308
- });
1295
+ var safeHtml;
1296
+ var htmlContent = this.simpleMarkdownParser(markdownContent);
1297
+ return htmlContent;
1309
1298
  };
1310
1299
  return ChatDrawerComponent;
1311
1300
  }());