Skip to main content

Text Block

Body

{
"id": "OEUfFhiP4", // Block ID
"type": "text", // Block type
"text": [
{
"insert": "Body Text"
}
]
}
{
"id": "mZN0ziE8q", // Block ID
"type": "text", // Block type
"text": [
{
"attributes": {
"link": "https://ones.cn" // url
},
"insert": "ONES Link"
}
]
}

Title

{
"id": "xniMxgZeD", // Block ID
"type": "text" // Block type
"text": [{
"insert": "Title Text"
}],
"heading": 1, // Range 1-8
}

Quotation

{
"id": "C81S8ZLeK", // Block ID
"type": "text" // Block type
"text": [{
"insert": "Quoted Text"
}],
"quoted": true,
}

Style

{
"id": "GTOY6EzE7", // Block ID
"type": "text", // Block type
"text": [
{
"attributes": {
"style-bold": true, // Bold
"style-italic": true, // Italic
"style-underline": true, // Underline
"style-strikethrough": true, // Strikethrough
"style-color-{num}": true, // Text color num range [0, 6]
"style-bg-color-{num}": true, // Background color num range [0, 14]
"style-code": true, // Inline code
"style-super": true, // Superscript (cannot coexist with style-sub)
"style-sub": true, // Subscript (cannot coexist with style-super)
},
"insert": "Text"
}
],
"align": "left" // Alignment: "left" (default), "center", "right"
}

Color Corresponding Values

Examples

Code

{
"blocks": [
{
"id": "DzbsJ1DLa",
"type": "text",
"text": [
{
"insert": "Text Demo"
}
],
"heading": 1,
"quoted": false
},
{
"id": "xniMxgZeD",
"type": "text",
"text": [
{
"attributes": {
"inline-style-font-size": "16px"
},
"insert": "Title 1"
}
],
"heading": 1
},
{
"id": "tuCroqPYf",
"type": "text",
"text": [
{
"insert": "Title 2",
"attributes": {
"inline-style-font-size": "16px"
}
}
],
"heading": 2
},
{
"id": "CS8gFrCpx",
"type": "text",
"text": [
{
"attributes": {
"inline-style-font-size": "16px"
},
"insert": "Title 3"
}
],
"heading": 3
},
{
"id": "QDBGMqfP5",
"type": "text",
"text": [
{
"attributes": {
"inline-style-font-size": "16px"
},
"insert": "Title 4"
}
],
"heading": 4
},
{
"id": "tN9TC3Zkt",
"type": "text",
"text": [
{
"insert": "Title 5",
"attributes": {
"inline-style-font-size": "16px"
}
}
],
"heading": 5
},
{
"id": "rGOr3lnXX",
"type": "text",
"text": [
{
"insert": "Main text",
"attributes": {
"inline-style-font-size": "16px"
}
}
]
},
{
"id": "mypSYaCNK",
"type": "text",
"text": [
{
"attributes": {
"inline-style-font-size": "16px"
},
"insert": "Quotation"
}
],
"quoted": true
},
{
"id": "kMz8ERkQf",
"type": "text",
"text": [
{
"attributes": {
"style-bold": true,
"inline-style-font-size": "16px"
},
"insert": "Bold"
},
{
"attributes": {
"inline-style-font-size": "16px"
},
"insert": ", "
},
{
"attributes": {
"style-italic": true,
"inline-style-font-size": "16px"
},
"insert": "Italic"
},
{
"attributes": {
"inline-style-font-size": "16px"
},
"insert": ", "
},
{
"attributes": {
"style-underline": true,
"inline-style-font-size": "16px"
},
"insert": "Underline"
},
{
"attributes": {
"inline-style-font-size": "16px"
},
"insert": ", "
},
{
"attributes": {
"style-strikethrough": true,
"inline-style-font-size": "16px"
},
"insert": "Strikethrough"
},
{
"attributes": {
"inline-style-font-size": "16px"
},
"insert": ", "
},
{
"attributes": {
"style-bg-color-2": true,
"inline-style-font-size": "16px"
},
"insert": "Background color"
},
{
"attributes": {
"inline-style-font-size": "16px"
},
"insert": ", "
},
{
"attributes": {
"style-color-0": true,
"inline-style-font-size": "16px"
},
"insert": "Text color"
},
{
"attributes": {
"inline-style-font-size": "16px"
},
"insert": ", "
},
{
"attributes": {
"style-code": true,
"inline-style-font-size": "16px"
},
"insert": "Inline code"
},
{
"attributes": {
"inline-style-font-size": "16px"
},
"insert": ", "
},
{
"attributes": {
"style-super": true,
"inline-style-font-size": "16px"
},
"insert": "Superscript"
},
{
"insert": ", ",
"attributes": {
"inline-style-font-size": "16px"
}
},
{
"insert": "Subscript",
"attributes": {
"style-sub": true,
"inline-style-font-size": "16px"
}
}
]
},
{
"id": "nKE3zh1e4",
"type": "text",
"text": [
{
"insert": "Left alignment (default)"
}
]
},
{
"id": "R_inDySxi",
"type": "text",
"text": [
{
"insert": "Center alignment"
}
],
"align": "center"
},
{
"id": "Dk9RgiFpD",
"type": "text",
"text": [
{
"insert": "Right alignment"
}
],
"align": "right"
},
{
"id": "mZN0ziE8q",
"type": "text",
"text": [
{
"attributes": {
"link": "https://ones.cn"
},
"insert": "ONES Link"
}
]
}
]
}