@uniweb/semantic-parser 1.1.2 → 1.1.3
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/package.json +1 -1
- package/src/processors/groups.js +8 -1
package/package.json
CHANGED
package/src/processors/groups.js
CHANGED
|
@@ -405,7 +405,14 @@ function identifyMainContent(groups) {
|
|
|
405
405
|
const first = groups[0].metadata.level;
|
|
406
406
|
const second = groups[1].metadata.level;
|
|
407
407
|
|
|
408
|
-
|
|
408
|
+
// First group has a heading more important than second → main
|
|
409
|
+
if (first && (!second || first < second)) return true;
|
|
410
|
+
|
|
411
|
+
// First group has NO heading (just body content before first heading) → promote to main
|
|
412
|
+
// This prevents empty-titled first items when content precedes headings
|
|
413
|
+
if (!first && second) return true;
|
|
414
|
+
|
|
415
|
+
return false;
|
|
409
416
|
}
|
|
410
417
|
|
|
411
418
|
function processInlineElements(children, body) {
|