This issue has been created
 
 
XWiki Platform / cid:jira-generated-image-avatar-c2bc94c7-89a3-4c8b-a802-a848748dd750 XWIKI-24011 Open

Fail to edit a quote with multiple child blocks

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-d03111cf-5b9c-4bea-acc2-d3bd25300dcc Marius Dumitru Florea created this issue on 12/Feb/26 16:23
 
Summary: Fail to edit a quote with multiple child blocks
Issue Type: cid:jira-generated-image-avatar-c2bc94c7-89a3-4c8b-a802-a848748dd750 Bug
Affects Versions: 18.0.1
Assignee: Unassigned
Components: Blocknote
Created: 12/Feb/26 16:23
Priority: cid:jira-generated-image-static-major-1e7204d6-29ed-41ef-9718-0bfc23ee4b5e Major
Reporter: Marius Dumitru Florea
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