@gendive/chatllm 0.17.17 → 0.17.18
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/react/index.mjs
CHANGED
|
@@ -1381,12 +1381,12 @@ var parsePollFromContent = (content) => {
|
|
|
1381
1381
|
let optionMatch;
|
|
1382
1382
|
while ((optionMatch = optionTagRegex.exec(innerContent)) !== null) {
|
|
1383
1383
|
const optionAttrs = optionMatch[1];
|
|
1384
|
-
const optionLabel =
|
|
1384
|
+
const optionLabel = optionMatch[2].trim();
|
|
1385
1385
|
const descMatch = optionAttrs.match(/description=["']([^"']+)["']/i);
|
|
1386
1386
|
options.push({
|
|
1387
1387
|
id: generateId2(),
|
|
1388
1388
|
label: optionLabel,
|
|
1389
|
-
description: descMatch?.[1]
|
|
1389
|
+
description: descMatch?.[1] || void 0
|
|
1390
1390
|
});
|
|
1391
1391
|
}
|
|
1392
1392
|
if (options.length === 0) {
|
|
@@ -1396,8 +1396,8 @@ var parsePollFromContent = (content) => {
|
|
|
1396
1396
|
const fullText = listMatch[1].trim();
|
|
1397
1397
|
const colonIndex = fullText.indexOf(":");
|
|
1398
1398
|
if (colonIndex > 0) {
|
|
1399
|
-
const label =
|
|
1400
|
-
const description =
|
|
1399
|
+
const label = fullText.substring(0, colonIndex).trim();
|
|
1400
|
+
const description = fullText.substring(colonIndex + 1).trim();
|
|
1401
1401
|
options.push({
|
|
1402
1402
|
id: generateId2(),
|
|
1403
1403
|
label,
|
|
@@ -1406,7 +1406,7 @@ var parsePollFromContent = (content) => {
|
|
|
1406
1406
|
} else {
|
|
1407
1407
|
options.push({
|
|
1408
1408
|
id: generateId2(),
|
|
1409
|
-
label:
|
|
1409
|
+
label: fullText
|
|
1410
1410
|
});
|
|
1411
1411
|
}
|
|
1412
1412
|
}
|
|
@@ -1417,14 +1417,14 @@ var parsePollFromContent = (content) => {
|
|
|
1417
1417
|
while ((numMatch = numberedRegex.exec(innerContent)) !== null) {
|
|
1418
1418
|
options.push({
|
|
1419
1419
|
id: generateId2(),
|
|
1420
|
-
label:
|
|
1420
|
+
label: numMatch[1].trim()
|
|
1421
1421
|
});
|
|
1422
1422
|
}
|
|
1423
1423
|
}
|
|
1424
1424
|
if (questionText && options.length >= 2) {
|
|
1425
1425
|
const pollQuestion = {
|
|
1426
1426
|
id: generateId2(),
|
|
1427
|
-
question:
|
|
1427
|
+
question: questionText,
|
|
1428
1428
|
options,
|
|
1429
1429
|
multiSelect,
|
|
1430
1430
|
allowOther,
|
|
@@ -1454,7 +1454,7 @@ var parsePollFromContent = (content) => {
|
|
|
1454
1454
|
};
|
|
1455
1455
|
};
|
|
1456
1456
|
var formatPollResponse = (question, selectedOptions, otherText) => {
|
|
1457
|
-
const selectedLabels = question.options.filter((opt) => selectedOptions.includes(opt.id)).map((opt) => opt.label);
|
|
1457
|
+
const selectedLabels = question.options.filter((opt) => selectedOptions.includes(opt.id)).map((opt) => stripInlineMarkdown(opt.label));
|
|
1458
1458
|
if (otherText) {
|
|
1459
1459
|
selectedLabels.push(otherText);
|
|
1460
1460
|
}
|