Skip to content

Commit 4bbb55d

Browse files
committed
expandable as quote
1 parent a1ff7c7 commit 4bbb55d

7 files changed

Lines changed: 23 additions & 21 deletions

File tree

elementary/messages/formats/markdown.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ def format_table_block(self, block: TableBlock) -> str:
107107
raise ValueError(f"Invalid table style: {self._table_style}")
108108

109109
def format_expandable_block(self, block: ExpandableBlock) -> str:
110-
return f"**{block.title}**\\\n{self.format_message_blocks(block.body)}"
110+
body = self.format_message_blocks(block.body)
111+
quoted_body = "\n> ".join(body.split("\n"))
112+
return f"> **{block.title}**\\\n> {quoted_body}"
111113

112114
def format_message_block(self, block: MessageBlock) -> str:
113115
if isinstance(block, HeaderBlock):

tests/unit/messages/formats/markdown/fixtures/all_blocks_green.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ Normal text **Bold text** _Italic text_
99

1010
Status: Passed | Tags: test, example
1111

12-
**Show Details**\
13-
🔎 **Details Section**\
14-
Here's some content with a [link](https://example.com)
12+
> **Show Details**\
13+
> 🔎 **Details Section**\
14+
> Here's some content with a [link](https://example.com)
1515
1616
user1 `select 1`

tests/unit/messages/formats/markdown/fixtures/all_blocks_no_color.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ Normal text **Bold text** _Italic text_
99

1010
Status: Passed | Tags: test, example
1111

12-
**Show Details**\
13-
🔎 **Details Section**\
14-
Here's some content with a [link](https://example.com)
12+
> **Show Details**\
13+
> 🔎 **Details Section**\
14+
> Here's some content with a [link](https://example.com)
1515
1616
user1 `select 1`

tests/unit/messages/formats/markdown/fixtures/all_blocks_red.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ Normal text **Bold text** _Italic text_
99

1010
Status: Passed | Tags: test, example
1111

12-
**Show Details**\
13-
🔎 **Details Section**\
14-
Here's some content with a [link](https://example.com)
12+
> **Show Details**\
13+
> 🔎 **Details Section**\
14+
> Here's some content with a [link](https://example.com)
1515
1616
user1 `select 1`

tests/unit/messages/formats/markdown/fixtures/all_blocks_yellow.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ Normal text **Bold text** _Italic text_
99

1010
Status: Passed | Tags: test, example
1111

12-
**Show Details**\
13-
🔎 **Details Section**\
14-
Here's some content with a [link](https://example.com)
12+
> **Show Details**\
13+
> 🔎 **Details Section**\
14+
> Here's some content with a [link](https://example.com)
1515
1616
user1 `select 1`
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
**Show More**\
2-
Hidden content
1+
> **Show More**\
2+
> Hidden content
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
**Outer Block**\
2-
🔎 **Title with Icon**\
3-
Some content with a [link](https://example.com)
4-
5-
**Inner Block**\
6-
Inner content
1+
> **Outer Block**\
2+
> 🔎 **Title with Icon**\
3+
> Some content with a [link](https://example.com)
4+
>
5+
> > **Inner Block**\
6+
> > Inner content

0 commit comments

Comments
 (0)