@uniweb/semantic-parser 1.0.14 → 1.0.15

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.0.14",
3
+ "version": "1.0.15",
4
4
  "description": "Semantic parser for ProseMirror/TipTap content structures",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
@@ -378,7 +378,7 @@ function processInlineElements(content) {
378
378
  items.push({
379
379
  type: "link",
380
380
  attrs: {
381
- href: linkMark.attrs?.href,
381
+ ...linkMark.attrs, // Preserve all link attributes (role, target, etc.)
382
382
  label: item.text || "",
383
383
  },
384
384
  });
@@ -620,7 +620,7 @@ function isLink(item) {
620
620
  }
621
621
 
622
622
  return {
623
- href: mark?.attrs?.href,
623
+ ...mark?.attrs, // Preserve all link attributes (role, target, etc.)
624
624
  label: contentItem?.text || "",
625
625
  iconBefore,
626
626
  iconAfter,
@@ -673,14 +673,14 @@ function isOnlyLinks(item) {
673
673
 
674
674
  if (!allLinks) return false;
675
675
 
676
- // Extract links as simple {href, label} objects
676
+ // Extract links with all their attributes
677
677
  // Icons in this paragraph go to body.icons separately (no association)
678
678
  return textContent.map((c) => {
679
679
  const linkMark = c.marks.find((m) => m.type === "link");
680
680
  return {
681
681
  type: "link",
682
682
  attrs: {
683
- href: linkMark?.attrs?.href,
683
+ ...linkMark?.attrs, // Preserve all link attributes (role, target, etc.)
684
684
  label: c.text || "",
685
685
  },
686
686
  };