Skip to content

Commit 0c67c39

Browse files
claudejlevy
authored andcommitted
fix: add blank line after paragraphs before list items
Ensures consistent spacing by always adding a blank line after standalone paragraphs before list items. This matches the behavior already implemented for headings and improves readability. The fix simplifies render_paragraph() to unconditionally set _suppress_item_break = False, which ensures blank lines are added before list items in all contexts (top-level and nested). Also removes docs/ directory containing bug reproduction examples as both bugs have been fixed. Related to previous commit fixing blank lines after headings. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 0a59089 commit 0c67c39

File tree

3 files changed

+3
-13
lines changed

3 files changed

+3
-13
lines changed

‎docs/bug1-example.md‎

Lines changed: 0 additions & 2 deletions
This file was deleted.

‎docs/bug2-example.md‎

Lines changed: 0 additions & 4 deletions
This file was deleted.

‎src/flowmark/formats/flowmark_markdown.py‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,9 @@ def container(self, prefix: str, second_prefix: str = "") -> Generator[None, Non
8383
self._prefix, self._second_prefix = old_prefix, old_second_prefix
8484

8585
def render_paragraph(self, element: block.Paragraph) -> str:
86-
# Suppress item breaks on list items following a top-level paragraph.
87-
if not self._prefix:
88-
self._suppress_item_break = True
89-
else:
90-
# For paragraphs within list items, ensure proper spacing after multi-paragraph items
91-
# This handles the case where a paragraph follows a BlankLine within a list item
92-
self._suppress_item_break = False
86+
# After rendering a paragraph, don't suppress the next item break
87+
# This ensures proper spacing before list items that follow paragraphs
88+
self._suppress_item_break = False
9389

9490
children: Any = self.render_children(element)
9591

0 commit comments

Comments
 (0)