Page tree
Skip to end of metadata
Go to start of metadata

릴리즈 3.0.2406 이상

Returns the current editor's Body model as a JSON Object or JSON String.


Parameters:

Name

Type

Attribute

Description

toString

boolean

default : false

Set whether to return the current editor body model as a JSON String.

Return:

TypeDescription
Object | StringBody model JSON Object or JSON String.



Example:

var model = editor.getBodyModelJSON();
var model = editor.getBodyModelJSON(true);
toString: false
{
    "id": "se_5a9f922e-db5a-41cf-b026-00a020125348",
    "type": "Body",
    "fromHTMLBuilder": false,
    "style": {},
    "children": [
        {
            "style": {},
            "children": [
                {
                    "text": "안녕하세요.",
                    "isEmoji": false,
                    "style": {},
                    "id": "se_7e1a7f55-cb5d-4fa7-997f-a22b90969131",
                    "type": "TextRun"
                }
            ],
            "id": "se_2e8fd0e1-1a58-4e24-b939-09bac14c24a2",
            "className": "",
            "type": "Paragraph",
            "fromHTMLBuilder": false,
            "defaultStyle": {
                "margin": {
                    "top": 16,
                    "left": 0,
                    "right": 0,
                    "bottom": 16
                },
                "display": "block",
                "overflowWrap": "break-word"
            },
            "tagName": "P",
            "endRunStyle": {}
        }
    ],
    "pageInfo": {
        "padding": {
            "left": 23,
            "right": 23,
            "top": 18,
            "bottom": 18
        }
    },
    "styleSheet": "",
    "linkTagStr": "",
    "scriptStrs": []
}
toString: true
'{"id":"se_5a9f922e-db5a-41cf-b026-00a020125348","type":"Body","fromHTMLBuilder":false,"style":{},"children":[{"style":{},"children":[{"text":"안녕하세요.","isEmoji":false,"style":{},"id":"se_7e1a7f55-cb5d-4fa7-997f-a22b90969131","type":"TextRun"}],"id":"se_2e8fd0e1-1a58-4e24-b939-09bac14c24a2","className":"","type":"Paragraph","fromHTMLBuilder":false,"defaultStyle":{"margin":{"top":16,"left":0,"right":0,"bottom":16},"display":"block","overflowWrap":"break-word"},"tagName":"P","endRunStyle":{}}],"pageInfo":{"padding":{"left":23,"right":23,"top":18,"bottom":18}},"styleSheet":"","linkTagStr":"","scriptStrs":[]}'
  • No labels