Skip to content

Commit e5a2825

Browse files
authored
feat(models): add underline to rich text section block element (#1771)
1 parent e9e64d8 commit e5a2825

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

slack_sdk/models/blocks/block_elements.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2032,18 +2032,21 @@ def __init__(
20322032
italic: Optional[bool] = None,
20332033
strike: Optional[bool] = None,
20342034
code: Optional[bool] = None,
2035+
underline: Optional[bool] = None,
20352036
):
20362037
self.bold = bold
20372038
self.italic = italic
20382039
self.strike = strike
20392040
self.code = code
2041+
self.underline = underline
20402042

20412043
def to_dict(self, *args) -> dict:
20422044
result = {
20432045
"bold": self.bold,
20442046
"italic": self.italic,
20452047
"strike": self.strike,
20462048
"code": self.code,
2049+
"underline": self.underline,
20472050
}
20482051
return {k: v for k, v in result.items() if v is not None}
20492052

tests/slack_sdk/models/test_blocks.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,6 +1037,8 @@ def test_complex(self):
10371037
{"type": "text", "text": "block", "style": {"code": True}},
10381038
{"type": "text", "text": " "},
10391039
{"type": "text", "text": "test", "style": {"italic": True}},
1040+
{"type": "text", "text": " "},
1041+
{"type": "text", "text": "links", "style": {"underline": True}},
10401042
{"type": "link", "url": "https://slack.com", "text": "Slack website!"},
10411043
],
10421044
},
@@ -1138,6 +1140,8 @@ def test_complex(self):
11381140
_.Text(text="block", style=_.TextStyle(code=True)),
11391141
_.Text(text=" "),
11401142
_.Text(text="test", style=_.TextStyle(italic=True)),
1143+
_.Text(text=" "),
1144+
_.Text(text="links", style=_.TextStyle(underline=True)),
11411145
_.Link(text="Slack website!", url="https://slack.com"),
11421146
]
11431147
),

0 commit comments

Comments
 (0)