@zodic/shared 0.0.242 → 0.0.243
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/app/services/ConceptService.ts +12 -13
- package/package.json +1 -1
|
@@ -2178,21 +2178,21 @@ export class ConceptService {
|
|
|
2178
2178
|
const languageSections = response
|
|
2179
2179
|
.split(/--\s*(EN|PT)\s*\n/)
|
|
2180
2180
|
.filter(Boolean);
|
|
2181
|
-
|
|
2181
|
+
|
|
2182
2182
|
for (let i = 0; i < languageSections.length; i += 2) {
|
|
2183
2183
|
const language = languageSections[i].trim();
|
|
2184
2184
|
const content = languageSections[i + 1]?.trim();
|
|
2185
2185
|
if (!content || !language.match(/^(EN|PT)$/)) continue;
|
|
2186
|
-
|
|
2186
|
+
|
|
2187
2187
|
const report: AstrologicalReport = {
|
|
2188
2188
|
language,
|
|
2189
2189
|
title: [],
|
|
2190
2190
|
sections: {},
|
|
2191
2191
|
};
|
|
2192
|
-
|
|
2192
|
+
|
|
2193
2193
|
const lines = content.split('\n').map((line) => line.trim());
|
|
2194
2194
|
let currentSection = '';
|
|
2195
|
-
|
|
2195
|
+
|
|
2196
2196
|
for (const line of lines) {
|
|
2197
2197
|
if (line.startsWith('### ') && report.title.length === 0) {
|
|
2198
2198
|
report.title.push({
|
|
@@ -2201,19 +2201,18 @@ export class ConceptService {
|
|
|
2201
2201
|
});
|
|
2202
2202
|
continue;
|
|
2203
2203
|
}
|
|
2204
|
-
|
|
2204
|
+
|
|
2205
2205
|
if (line.startsWith('#### ')) {
|
|
2206
2206
|
currentSection = cleanText(line.replace('#### ', '').trim());
|
|
2207
|
-
report.sections[currentSection] =
|
|
2208
|
-
report.sections[currentSection] || [];
|
|
2207
|
+
report.sections[currentSection] = report.sections[currentSection] || [];
|
|
2209
2208
|
continue;
|
|
2210
2209
|
}
|
|
2211
|
-
|
|
2210
|
+
|
|
2212
2211
|
if (!line || !currentSection) continue;
|
|
2213
|
-
|
|
2212
|
+
|
|
2214
2213
|
if (line.match(/^\d+\.\s/) || line.startsWith('- ')) {
|
|
2215
2214
|
const listItem = line.replace(/^\d+\.\s|- /, '').trim();
|
|
2216
|
-
const boldMatch = listItem.match(/^\*\*(.+?)
|
|
2215
|
+
const boldMatch = listItem.match(/^\*\*(.+?)\*\*[:\s]*(.+)$/); // Updated regex
|
|
2217
2216
|
if (boldMatch) {
|
|
2218
2217
|
report.sections[currentSection].push({
|
|
2219
2218
|
type: 'bullet-point',
|
|
@@ -2228,16 +2227,16 @@ export class ConceptService {
|
|
|
2228
2227
|
}
|
|
2229
2228
|
continue;
|
|
2230
2229
|
}
|
|
2231
|
-
|
|
2230
|
+
|
|
2232
2231
|
report.sections[currentSection].push({
|
|
2233
2232
|
type: 'p',
|
|
2234
2233
|
content: cleanText(line),
|
|
2235
2234
|
});
|
|
2236
2235
|
}
|
|
2237
|
-
|
|
2236
|
+
|
|
2238
2237
|
reports.push(report);
|
|
2239
2238
|
}
|
|
2240
|
-
|
|
2239
|
+
|
|
2241
2240
|
return reports;
|
|
2242
2241
|
}
|
|
2243
2242
|
}
|