Skip to content

Conversation

gonzalezreal
Copy link
Owner

@gonzalezreal gonzalezreal commented Apr 9, 2023

This pull request adds the block's Markdown content value to the block style configuration. This allows the block style to access the actual Markdown content rendered in the block style configuration label property.

You can use the renderMarkdown() and renderPlainText() methods on the content property to render the Markdown-formatted or plain text, respectively.

configuration.content.renderMarkdownText()
configuration.content.renderPlainText()

If you are styling a container block, like a list or a blockquote, you can access the child content using the childContent property.

configuration.content.childContent?.renderMarkdownText()

As a result of this change, all the block-style methods with a label closure are now deprecated. When creating new themes or overriding block styles, you should use the version of the method that takes a closure receiving a BlockConfiguration value.

@gonzalezreal gonzalezreal marked this pull request as ready for review April 9, 2023 18:52
@gonzalezreal gonzalezreal merged commit c51f1a1 into main Apr 11, 2023
@gonzalezreal gonzalezreal deleted the add-content-to-block-configuration branch April 11, 2023 09:47
@leecaa leecaa mentioned this pull request May 24, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant