@hivegpt/hiveai-angular 0.0.60 → 0.0.62
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/bundles/hivegpt-hiveai-angular.umd.js +18 -28
- package/bundles/hivegpt-hiveai-angular.umd.js.map +1 -1
- package/bundles/hivegpt-hiveai-angular.umd.min.js +1 -1
- package/bundles/hivegpt-hiveai-angular.umd.min.js.map +1 -1
- package/esm2015/lib/components/chat-drawer/chat-drawer.component.js +19 -29
- package/fesm2015/hivegpt-hiveai-angular.js +18 -28
- package/fesm2015/hivegpt-hiveai-angular.js.map +1 -1
- package/lib/components/chat-drawer/chat-drawer.component.d.ts +1 -1
- package/lib/components/chat-drawer/chat-drawer.component.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1266,38 +1266,28 @@
|
|
|
1266
1266
|
};
|
|
1267
1267
|
// events/${eventId}/users-connections
|
|
1268
1268
|
// Simple Markdown to HTML parser
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
if (!markdownContent)
|
|
1269
|
+
ChatDrawerComponent.prototype.simpleMarkdownParser = function (markdown) {
|
|
1270
|
+
if (!markdown || !(markdown.length > 0)) {
|
|
1272
1271
|
return '';
|
|
1273
|
-
|
|
1274
|
-
// Convert
|
|
1275
|
-
html =
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
html = html.replace(
|
|
1281
|
-
// Convert bold
|
|
1282
|
-
html = html.replace(
|
|
1283
|
-
|
|
1284
|
-
html = html.replace(
|
|
1285
|
-
//
|
|
1286
|
-
|
|
1287
|
-
|
|
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>');
|
|
1291
|
-
// 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/>');
|
|
1295
|
-
return html.trim();
|
|
1272
|
+
}
|
|
1273
|
+
// Convert Markdown headers to HTML headers
|
|
1274
|
+
var html = markdown.replace(/^(#{1,6})\s+(.*)$/gm, function (match, hashes, text) {
|
|
1275
|
+
var level = hashes.length;
|
|
1276
|
+
return "<h" + level + ">" + text + "</h" + level + ">";
|
|
1277
|
+
});
|
|
1278
|
+
// Convert Markdown links to HTML links
|
|
1279
|
+
html = html.replace(/\[([^\]]+)]\(([^)]+)\)/g, '<a href="$2" target="_blank">$1</a>');
|
|
1280
|
+
// Convert Markdown bold to HTML strong
|
|
1281
|
+
html = html.replace(/\*\*(.*?)\*\*/g, '<strong>$1</strong>');
|
|
1282
|
+
// Convert new lines to <br> tags
|
|
1283
|
+
html = html.replace(/(?:\r\n|\r|\n)/g, '<br>');
|
|
1284
|
+
// Optional: Sanitize the HTML to prevent XSS
|
|
1285
|
+
var sanitizedHtml = this.sanitizeHtml(html);
|
|
1286
|
+
return sanitizedHtml;
|
|
1296
1287
|
};
|
|
1297
1288
|
// Convert Markdown to SafeHtml
|
|
1298
1289
|
ChatDrawerComponent.prototype.handleMarkdown = function (markdownContent) {
|
|
1299
|
-
|
|
1300
|
-
return this.sanitizer.bypassSecurityTrustHtml(htmlContent);
|
|
1290
|
+
return this.sanitizer.bypassSecurityTrustHtml(markdownContent);
|
|
1301
1291
|
};
|
|
1302
1292
|
return ChatDrawerComponent;
|
|
1303
1293
|
}());
|