Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions block-kit/src/main/java/blocks/Card.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ public class Card {
public static CardBlock example01() {
CardBlock block = Blocks.card(c -> c.icon(BlockElements.imageElement(
i -> i.imageUrl("https://picsum.photos/36/36").altText("Icon")))
.title(BlockCompositions.markdownText("Lumon Industries"))
.subtitle(BlockCompositions.markdownText("Committed to work-life balance"))
.title(BlockCompositions.markdownText(
mt -> mt.text("Lumon Industries").verbatim(false)))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: Setting .verbatim(false) inline on each text object is the right call, since the SDK only serializes verbatim when it is set. The test now pins the exact docs JSON too 🎴

.subtitle(BlockCompositions.markdownText(
mt -> mt.text("Committed to work-life balance").verbatim(false)))
.heroImage(BlockElements.imageElement(
i -> i.imageUrl("https://picsum.photos/400/300").altText("Sample hero image")))
.body(BlockCompositions.markdownText("Please enjoy each card equally."))
.body(BlockCompositions.markdownText(
mt -> mt.text("Please enjoy each card equally.").verbatim(false)))
.actions(List.of(BlockElements.button(b -> b.text(BlockCompositions.plainText(
pt -> pt.text("Action Button").emoji(false)))
.actionId("button_action")))));
Expand Down
9 changes: 6 additions & 3 deletions block-kit/src/test/java/blocks/CardTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ public void testExample01() {
},
"title": {
"type": "mrkdwn",
"text": "Lumon Industries"
"text": "Lumon Industries",
"verbatim": false
},
"subtitle": {
"type": "mrkdwn",
"text": "Committed to work-life balance"
"text": "Committed to work-life balance",
"verbatim": false
},
"hero_image": {
"type": "image",
Expand All @@ -35,7 +37,8 @@ public void testExample01() {
},
"body": {
"type": "mrkdwn",
"text": "Please enjoy each card equally."
"text": "Please enjoy each card equally.",
"verbatim": false
},
"actions": [
{
Expand Down
Loading