@zodic/shared 0.0.244 → 0.0.245
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.
|
@@ -2204,9 +2204,9 @@ export class ConceptService {
|
|
|
2204
2204
|
console.log(`🔢 Split into ${lines.length} lines`);
|
|
2205
2205
|
|
|
2206
2206
|
let currentSection = '';
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
console.log(`📏 Processing line: "${line}"`);
|
|
2207
|
+
for (let j = 0; j < lines.length; j++) {
|
|
2208
|
+
const line = lines[j];
|
|
2209
|
+
console.log(`📏 Processing line ${j + 1}: "${line}"`);
|
|
2210
2210
|
|
|
2211
2211
|
if (line.startsWith('### ') && report.title.length === 0) {
|
|
2212
2212
|
const titleContent = cleanText(line.replace('### ', ''));
|
|
@@ -2233,15 +2233,28 @@ export class ConceptService {
|
|
|
2233
2233
|
if (line.match(/^\d+\.\s/) || line.startsWith('- ')) {
|
|
2234
2234
|
const listItem = line.replace(/^\d+\.\s|- /, '').trim();
|
|
2235
2235
|
console.log(`🔹 Bullet point detected: "${listItem}"`);
|
|
2236
|
-
const boldMatch = listItem.match(/^\*\*(.+?)\*\*[:\s]*(.+)
|
|
2236
|
+
const boldMatch = listItem.match(/^\*\*(.+?)\*\*[:\s]*(.+)?$/); // Updated to allow standalone bold
|
|
2237
|
+
|
|
2237
2238
|
if (boldMatch) {
|
|
2238
2239
|
const title = cleanText(boldMatch[1]);
|
|
2239
|
-
|
|
2240
|
-
|
|
2240
|
+
let content = boldMatch[2] ? cleanText(boldMatch[2]) : '';
|
|
2241
|
+
|
|
2242
|
+
// Look ahead for content if none on the same line
|
|
2243
|
+
if (!content && j + 1 < lines.length) {
|
|
2244
|
+
const nextLine = lines[j + 1];
|
|
2245
|
+
console.log(`🔍 Checking next line for content: "${nextLine}"`);
|
|
2246
|
+
if (nextLine && !nextLine.match(/^\d+\.\s|- /) && !nextLine.startsWith('#### ') && !nextLine.startsWith('### ')) {
|
|
2247
|
+
content = cleanText(nextLine);
|
|
2248
|
+
console.log(`✅ Found content in next line: "${content}"`);
|
|
2249
|
+
j++; // Skip the next line since we’ve consumed it
|
|
2250
|
+
}
|
|
2251
|
+
}
|
|
2252
|
+
|
|
2253
|
+
console.log(`✅ Bold match found - Title: "${title}", Content: "${content || 'None'}"`);
|
|
2241
2254
|
report.sections[currentSection].push({
|
|
2242
2255
|
type: 'bullet-point',
|
|
2243
2256
|
title,
|
|
2244
|
-
content,
|
|
2257
|
+
content: content || '', // Empty string if no content found
|
|
2245
2258
|
});
|
|
2246
2259
|
} else {
|
|
2247
2260
|
console.log(`❌ No bold match - Full content: "${listItem}"`);
|