Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-24017

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 18.1.0-rc-1
    • Blocknote
    • None
    • Unknown

    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. This is what we provide to BlockNote currently:

      {
        "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"
            }
          } ]
        } ]
      }
      

      Attachments

        Activity

          People

            mflorea Marius Dumitru Florea
            mflorea Marius Dumitru Florea
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: