@hivegpt/hiveai-angular 0.0.60 → 0.0.61

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,32 +1266,36 @@
1266
1266
  };
1267
1267
  // events/${eventId}/users-connections
1268
1268
  // Simple Markdown to HTML parser
1269
- // Simple Markdown to HTML parser
1270
1269
  ChatDrawerComponent.prototype.simpleMarkdownParser = function (markdownContent) {
1271
1270
  if (!markdownContent)
1272
1271
  return '';
1273
1272
  var html = String(markdownContent).trim(); // Ensure it's treated as a string and trim any extra spaces
1274
1273
  // Convert headings
1275
- html = html.replace(/^(###### .*)$/gim, '<h6>$1</h6>');
1276
- html = html.replace(/^(##### .*)$/gim, '<h5>$1</h5>');
1277
- html = html.replace(/^(#### .*)$/gim, '<h4>$1</h4>');
1278
- html = html.replace(/^(### .*)$/gim, '<h3>$1</h3>');
1279
- html = html.replace(/^(## .*)$/gim, '<h2>$1</h2>');
1280
- html = html.replace(/^(# .*)$/gim, '<h1>$1</h1>');
1274
+ html = html.replace(/^(###### (.*))$/gim, '<h6>$2</h6>');
1275
+ html = html.replace(/^(##### (.*))$/gim, '<h5>$2</h5>');
1276
+ html = html.replace(/^(#### (.*))$/gim, '<h4>$2</h4>');
1277
+ html = html.replace(/^(### (.*))$/gim, '<h3>$2</h3>');
1278
+ html = html.replace(/^(## (.*))$/gim, '<h2>$2</h2>');
1279
+ html = html.replace(/^(# (.*))$/gim, '<h1>$2</h1>');
1281
1280
  // Convert bold and italic
1282
1281
  html = html.replace(/\*\*\*(.*?)\*\*\*/gim, '<em><strong>$1</strong></em>');
1283
1282
  html = html.replace(/\*\*(.*?)\*\*/gim, '<strong>$1</strong>');
1284
1283
  html = html.replace(/\*(.*?)\*/gim, '<em>$1</em>');
1285
1284
  // Convert links
1286
- html = html.replace(/\[(.*?)\]\((.*?)\)/gim, '<a href="$2">$1</a>');
1285
+ html = html.replace(/\[(.*?)\]\((.*?)\)/gim, '<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>');
1287
1286
  // Convert unordered lists
1288
- html = html.replace(/^\* (.*)/gim, '<ul><li>$1</li></ul>');
1289
- html = html.replace(/^\- (.*)/gim, '<ul><li>$1</li></ul>');
1290
- 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
+ html = html.replace(/^\+ (.*)$/gim, '<ul><li>$1</li></ul>');
1291
1290
  // Convert ordered lists
1292
- html = html.replace(/^\d+\. (.*)/gim, '<ol><li>$1</li></ol>');
1293
- // Convert line breaks
1294
- html = html.replace(/\n/gim, '<br/>');
1291
+ html = html.replace(/^\d+\. (.*)$/gim, '<ol><li>$1</li></ol>');
1292
+ // Combine multiple list items in one list element
1293
+ html = html.replace(/(<ul><li>.*<\/li><\/ul>)/gim, function (match) {
1294
+ return "<ul>" + match.replace(/<\/li><li>/gim, '</li><li>') + "</ul>";
1295
+ });
1296
+ html = html.replace(/(<ol><li>.*<\/li><\/ol>)/gim, function (match) {
1297
+ return "<ol>" + match.replace(/<\/li><li>/gim, '</li><li>') + "</ol>";
1298
+ });
1295
1299
  return html.trim();
1296
1300
  };
1297
1301
  // Convert Markdown to SafeHtml