slab / delta

Simple and expressive JSON format for describing rich-text content and their changes
https://quilljs.com/docs/delta
BSD 3-Clause "New" or "Revised" License
914 stars 130 forks source link

RFC:Nested combinations #93

Open Fi2zz opened 10 months ago

Fi2zz commented 10 months ago
let delta = [
    {
        attributes: {
            type: "bullet-list-container",
        },
        children: [
            { insert: "Child 1" },
            { insert: "Child 2" },
            {
                insert: "Child 3",
                attributes: { type: "bullet-list-container" },
                children: [{ insert: "Sub Child 1" }, { insert: "Sub Child 2" }],
            },
        ],
    },
];

// output  to

/**

    <ul>
        <li>Child 1</li>
        <li>Child 2</li>
        <li>Child 3
                <ul>
                    <li>Sub Child 1</li>
                    <li>Sub Child 2</li>
                </ul>
        </li>

    </ul>

 */