Skip to content

Commit

Permalink
Merge pull request #390 from patrick91/patch-1
Browse files Browse the repository at this point in the history
Add block_quote prefix on empty lines too
  • Loading branch information
lepture authored Nov 7, 2024
2 parents 498f0e8 + a7c3a32 commit bf54ef6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/mistune/renderers/markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ def block_code(self, token: Dict[str, Any], state: BlockState) -> str:
return marker2 + info + "\n" + code + marker2 + "\n\n"

def block_quote(self, token: Dict[str, Any], state: BlockState) -> str:
text = indent(self.render_children(token, state), '> ')
text = indent(self.render_children(token, state), '> ', lambda _: True)
text = text.rstrip("> \n")
return text + '\n\n'

def block_html(self, token: Dict[str, Any], state: BlockState) -> str:
Expand Down
12 changes: 12 additions & 0 deletions tests/fixtures/renderer_markdown.txt
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,18 @@ hello
> quote
````````````````````````````````

> quote

> quote
>
> continuation
.
> quote

> quote
>
> continuation

## list

```````````````````````````````` example
Expand Down

0 comments on commit bf54ef6

Please sign in to comment.