Sorry, we don't support your browser.  Install a modern browser
This post is closed.

Avoid double JSON encoding in Kirby Blocks#316

The Blocks field stores data in JSON. However, if you have a blocks field within another blocks field, the nested blocks’ data will be double encoded. That’s unnecessary and also ruins indentation:

[
    {
        "content": {
            "nestedBlocks": "[{\"content\":{\"text\":\"<p>First text block.<\\/p>\"},\"id\":\"63112f8c-dc6a-47c5-9040-6d9d6bc828a7\",\"isHidden\":false,\"type\":\"text\"},{\"content\":{\"text\":\"<p>Second text block.<\\/p>\"},\"id\":\"a1f41e44-6cbb-4e06-8470-82b3665c93dd\",\"isHidden\":false,\"type\":\"text\"}]"
        },
        "id": "86a09cb5-7311-43b1-a4cb-03348af17092",
        "isHidden": false,
        "type": "my-block"
    }
]

This increases the file size of the TXT and renders Git diffs useless.

3 months ago
2
Changed the status to
Planned
10 hours ago
Changed the status to
Archived
10 hours ago
Locked this conversation
10 hours ago
Unlocked this conversation
10 hours ago

Archived in favor of the Github issue: https://github.com/getkirby/kirby/issues/3662

10 hours ago
Locked this conversation
10 hours ago