@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniweb/semantic-parser",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "Semantic parser for ProseMirror/TipTap content structures",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
@@ -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
- return first ? !second || first < second : false;
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) {