This issue has been created
There are 2 updates.
 
 
XWiki Platform / cid:jira-generated-image-avatar-0b1bf32c-78a1-4e55-902f-6e80aafb5e7c XWIKI-24017 Open

Links with generated labels are not visible in editor and are lost on save

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-ae0d9a78-a2f7-45e8-bc7c-ba3b36e87239 Marius Dumitru Florea created this issue on 12/Feb/26 20:55
 
Summary: Links with generated labels are not visible in editor and are lost on save
Issue Type: cid:jira-generated-image-avatar-0b1bf32c-78a1-4e55-902f-6e80aafb5e7c Bug
Affects Versions: 18.1.0-rc-1
Assignee: Unassigned
Components: Blocknote
Created: 12/Feb/26 20:55
Priority: cid:jira-generated-image-static-major-f23fec74-3d31-4314-a4b5-2428b8435b14 Major
Reporter: Marius Dumitru Florea
Description:

Create a page with this content:

https://www.xwiki.org [[Some.Page||anchor="Heading" queryString="foo=bar"]] attach:file.pdf [[label>>path:to/file.txt]]

Edit with BlockNote. Only the last link, that has a non-generated label is visible. On save, only the last link is preserved.

The root cause is that the generated link label is not included in the UniAst syntax. We need to pass it as custom link block metadata.

 
 

2 updates

 
cid:jira-generated-image-avatar-ae0d9a78-a2f7-45e8-bc7c-ba3b36e87239 Changes by Marius Dumitru Florea on 12/Feb/26 20:55
 
Description: Create a page with this content:

{noformat}
https://www.xwiki.org [[Some.Page||anchor="Heading" queryString="foo=bar"]] attach:file.pdf [[label>>path:to/file.txt]]
{noformat}

Edit with BlockNote. Only the last link, that has a non-generated label is visible. On save, only the last link is preserved.

The root cause is that the generated link label is not included in the UniAst syntax. We need to pass it as custom link block metadata.
This is what we provide to BlockNote currently:

{noformat}
{
  "blocks" : [ {
    "type" : "paragraph",
    "styles" : { },
    "content" : [ {
      "type" : "link",
      "content" : [ ],
      "target" : {
        "type" : "external",
        "url" : "https://www.xwiki.org"
      }
    }, {
      "type" : "text",
      "styles" : { },
      "content" : " "
    }, {
      "type" : "link",
      "content" : [ ],
      "target" : {
        "type" : "internal",
        "rawReference" : "Some.Page"
      }
    }, {
      "type" : "text",
      "styles" : { },
      "content" : " "
    }, {
      "type" : "link",
      "content" : [ ],
      "target" : {
        "type" : "internal",
        "rawReference" : "attach:file.pdf"
      }
    }, {
      "type" : "text",
      "styles" : { },
      "content" : " "
    }, {
      "type" : "link",
      "content" : [ {
        "type" : "text",
        "styles" : { },
        "content" : "label"
      } ],
      "target" : {
        "type" : "external",
        "url" : "path:to/file.txt"
      }
    } ]
  } ]
}
{noformat}
Assignee: Marius Dumitru Florea