Skip to content

Commit 7cdcf80

Browse files
authored
Merge pull request #202 from plone/support_html2blocks
Add support for collective.html2blocks (Fixes #201)
2 parents 168a02a + 4574499 commit 7cdcf80

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

news/201.bugfix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Support collective.html2blocks to convert HTML to Volto blocks as a replacement for blocks-conversion-tool.
2+
@pbauer

src/plone/volto/browser/migrate_richtext.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,9 @@ def get_blocks_from_richtext(
149149
r = requests.post(service_url, headers=headers, json=payload)
150150
r.raise_for_status()
151151
slate_data = r.json()
152-
slate_data = slate_data["data"]
152+
# blocks-conversion-tool vs. collective.html2blocks
153+
if isinstance(slate_data, dict) and "data" in slate_data:
154+
slate_data = slate_data["data"]
153155
blocks = {}
154156
uuids = []
155157
# generate slate blocks

0 commit comments

Comments
 (0)