|
@@ -102,6 +102,11 @@ class BlockQuote(StructBlock):
|
|
description = "A quote with an optional attribution"
|
|
description = "A quote with an optional attribution"
|
|
|
|
|
|
|
|
|
|
|
|
+class CustomEmbedBlock(EmbedBlock):
|
|
|
|
+ def get_api_representation(self, value, context=None):
|
|
|
|
+ return {"url": value.url, "html": value.html}
|
|
|
|
+
|
|
|
|
+
|
|
# StreamBlocks
|
|
# StreamBlocks
|
|
class BaseStreamBlock(StreamBlock):
|
|
class BaseStreamBlock(StreamBlock):
|
|
"""
|
|
"""
|
|
@@ -126,7 +131,7 @@ class BaseStreamBlock(StreamBlock):
|
|
)
|
|
)
|
|
image_block = CaptionedImageBlock()
|
|
image_block = CaptionedImageBlock()
|
|
block_quote = BlockQuote()
|
|
block_quote = BlockQuote()
|
|
- embed_block = EmbedBlock(
|
|
|
|
|
|
+ embed_block = CustomEmbedBlock(
|
|
help_text="Insert an embed URL e.g https://www.youtube.com/watch?v=SGJFWirQ3ks",
|
|
help_text="Insert an embed URL e.g https://www.youtube.com/watch?v=SGJFWirQ3ks",
|
|
icon="media",
|
|
icon="media",
|
|
template="blocks/embed_block.html",
|
|
template="blocks/embed_block.html",
|