style fix for li & ol: reduce margin and restore original disc#8768
style fix for li & ol: reduce margin and restore original disc#8768Light2Dark merged 4 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Made-with: Cursor
There was a problem hiding this comment.
Pull request overview
This PR adjusts Marimo’s markdown list rendering and styling to produce more compact HTML for nested lists, reduce list item margins in the frontend, and restore more typical nested bullet styles.
Changes:
- Update the breakless-lists tree processor to unwrap a single
<p>inside<li>when the rest of the list item is only nested lists. - Update/extend markdown output snapshot tests for nested list HTML structure and add new nested-list-focused test cases.
- Add CSS rules to reduce vertical spacing for list items and tweak nested unordered list bullet styles.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
tests/_output/test_md.py |
Updates snapshots for nested list HTML and adds new tests around paragraph unwrapping behavior. |
marimo/_output/md_extensions/breakless_lists.py |
Refactors list-item paragraph unwrapping logic to allow unwrapping when nested lists are present. |
frontend/src/css/md.css |
Reduces <li> margins and attempts to restore nested <ul> bullet style cycling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
This PR refines markdown list rendering to better match expected browser/Markdown behavior by making nested lists more compact in the generated HTML and adjusting frontend CSS to reduce list-item spacing and restore default nested bullet styles.
Changes:
- Update markdown HTML output snapshots for nested lists and add new tests around paragraph unwrapping behavior in list items.
- Adjust the BreaklessLists treeprocessor to unwrap a single
<p>inside<li>when it’s safe (including when followed by nested lists). - Update markdown CSS to reduce list item margins and restore default nested
<ul>bullet cycling.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/_output/test_md.py | Updates nested list snapshots and adds new tests for paragraph-unwrapping behavior in list items. |
| marimo/_smoke_tests/markdown/sane_lists.py | Regenerates/normalizes a markdown smoke-test notebook to reflect updated list behavior. |
| marimo/_output/md_extensions/breakless_lists.py | Refines <li> paragraph unwrapping logic to allow unwrapping when nested lists are present. |
| frontend/src/css/md.css | Reduces li vertical margins and restores default nested bullet styling for nested unordered lists. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - `code item`""" | ||
|
|
||
| result = _md(input_text, apply_markdown_class=False).text | ||
| assert result == snapshot( | ||
| """\ | ||
| <ul> | ||
| <li><strong>Bold item</strong></li> | ||
| <li><em>Nested italic</em><ul> | ||
| <li><code>code item</code></li> | ||
| </ul> | ||
| </li> |
|
🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.21.2-dev71 |
📝 Summary
Before

After

Before

After

Before

After

🔍 Description of Changes
📋 Checklist