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

Fail to edit a quote with multiple child blocks

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 18.0.1
    • Blocknote
    • None
    • Unknown

    Description

      The UniAst syntax says:

        | { type: "quote"; content: Block[]; styles: BlockStyles }
      

      which means a quote block should accept multiple child blocks. It doesn't seem to be the case though, because if I try to edit a page with this content:

      > one
      > two
      

      that produces this input UniAst syntax:

       {
        "blocks" : [ {
          "type" : "quote",
          "styles" : { },
          "content" : [ {
            "type" : "paragraph",
            "styles" : { },
            "content" : [ {
              "type" : "text",
              "styles" : { },
              "content" : " one"
            } ]
          }, {
            "type" : "paragraph",
            "styles" : { },
            "content" : [ {
              "type" : "text",
              "styles" : { },
              "content" : " two"
            } ]
          } ]
        } ]
      }
      

      the BlockNote editor fails to load the content:

      Failed to load document: Error: Expected a single paragraph inside custom block
      

      I can see the following error logged in the JavaScript console:

      Error: Expected a single paragraph inside custom block
          convertCustomBlockContent uniast-to-bn.ts:223
          convertBlock uniast-to-bn.ts:98
          uniAstToBlockNote uniast-to-bn.ts:60
          uniAstToBlockNote uniast-to-bn.ts:60
          dT index.ts:90
          uniAstToBlockNote uniast-to-bn.ts:59
          setup c-blocknote-view.vue:181
          tW vue.runtime.esm-browser.prod.js:5
          u vue.runtime.esm-browser.prod.js:7
          ib vue.runtime.esm-browser.prod.js:7
          $ vue.runtime.esm-browser.prod.js:7
          U vue.runtime.esm-browser.prod.js:7
          S vue.runtime.esm-browser.prod.js:7
          process vue.runtime.esm-browser.prod.js:7
          process vue.runtime.esm-browser.prod.js:7
          S vue.runtime.esm-browser.prod.js:7
          P vue.runtime.esm-browser.prod.js:7
          R vue.runtime.esm-browser.prod.js:7
          A vue.runtime.esm-browser.prod.js:7
          S vue.runtime.esm-browser.prod.js:7
          a vue.runtime.esm-browser.prod.js:7
          run vue.runtime.esm-browser.prod.js:5
          W vue.runtime.esm-browser.prod.js:7
          $ vue.runtime.esm-browser.prod.js:7
          U vue.runtime.esm-browser.prod.js:7
          S vue.runtime.esm-browser.prod.js:7
          er vue.runtime.esm-browser.prod.js:7
          mount vue.runtime.esm-browser.prod.js:7
          mount vue.runtime.esm-browser.prod.js:7
          QHe Logic.ts:79
          create Factory.js:42
          n inplace.js:51
          <anonymous> inplace.js:33
          jQuery 3
          trigger eventsBridge.js:35
          jQuery 4
          P InplaceEditing:923
          promise callback*I InplaceEditing:696
          promise callback*m InplaceEditing:380
          editPage InplaceEditing:326
          edit InplaceEditing:1049
      

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated: