Skip to content

fix: align numbered markdown lists when first token is bold#458

Merged
pedramamini merged 1 commit intoRunMaestro:mainfrom
sonwr:fix/markdown-ordered-list-alignment
Feb 25, 2026
Merged

fix: align numbered markdown lists when first token is bold#458
pedramamini merged 1 commit intoRunMaestro:mainfrom
sonwr:fix/markdown-ordered-list-alignment

Conversation

@sonwr
Copy link
Copy Markdown
Contributor

@sonwr sonwr commented Feb 25, 2026

Summary

Fixes numbered list alignment in markdown when a list item starts with bold (or other styled inline) content.

Problem

In some markdown content, ordered-list markers become visually misaligned when the first inline token is styled (for example **bold**).

Root cause

The prose style layer rendered li > p as inline, which can create marker/baseline inconsistencies with styled first tokens in ordered lists.

What changed

  • Changed markdown prose style for list paragraphs:
    • li > p from display: inline to display: block
  • Added small ordered-list spacing normalization:
    • ol li { padding-left: 0.15em; }
  • Added ordered-list marker consistency styling:
    • ol li::marker { font-variant-numeric: tabular-nums; font-weight: 400; }

Validation

  • Verified style output in markdown renderer path (generateProseStyles) and compared before/after behavior with ordered lists containing bold-leading items.

Scope

  • Targeted markdown rendering style fix only.
  • No auto-run/state-machine logic changes.

Summary by CodeRabbit

  • Style
    • Refined visual layout and presentation of paragraphs within list items, improving overall consistency and spacing
    • Enhanced ordered list styling with improved item padding and refined numeric marker formatting

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 25, 2026

📝 Walkthrough

Walkthrough

Modified markdown styling configuration to adjust list rendering. Changes include adding padding to ordered list items, switching paragraph children in list items from inline to block display, and adding tabular-numbers styling to ordered list markers.

Changes

Cohort / File(s) Summary
Markdown List Styling
src/renderer/utils/markdownConfig.ts
Added ol li padding rule, changed li > p from inline to block display with adjusted styling, and added ol li::marker tabular-nums font variant.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • PR #425: Directly conflicts with this change—PR #425 enforces inline display for list item paragraphs, while this PR reverts that to block display and modifies ordered list marker styling.
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: fixing ordered list alignment when list items start with bold text, achieved by modifying list item paragraph display styling.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Feb 25, 2026

Greptile Summary

This PR fixes numbered list alignment when list items start with bold or other styled inline content. The fix changes li > p from display: inline to display: block in the main generateProseStyles() function, and adds ordered-list specific styling:

Key changes:

  • Changed li > p to use display: block instead of display: inline
  • Removed vertical-align: baseline from li > p (already handled by existing rule for first-child styled elements)
  • Added ol li { padding-left: 0.15em; } for spacing normalization
  • Added ol li::marker { font-variant-numeric: tabular-nums; font-weight: 400; } for marker consistency

Issues found:

  • Test expectations at src/__tests__/renderer/utils/markdownConfig.test.ts:227-232 need updating to match new display: block behavior
  • generateTerminalProseStyles() still uses display: inline for li > p - consider whether consistency is needed

Confidence Score: 4/5

  • Safe to merge after updating test expectations
  • The fix is well-targeted and addresses the specific rendering issue described. However, test expectations need to be updated to match the new behavior (line 227-232 in markdownConfig.test.ts). There's also a minor consistency question about whether generateTerminalProseStyles() should have the same change.
  • Test file src/__tests__/renderer/utils/markdownConfig.test.ts needs updating to match new expectations

Important Files Changed

Filename Overview
src/renderer/utils/markdownConfig.ts Changes li > p from display: inline to display: block to fix ordered list alignment with bold-first items. Adds ol li padding and marker styling. Test expectations need updating.

Last reviewed commit: 5c5351e

Copy link
Copy Markdown

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

${s} li { margin: ${compactSpacing ? '0' : '0.25em 0'} !important; ${compactSpacing ? 'padding: 0;' : ''} line-height: 1.4; display: list-item; }
${s} li > p { margin: 0 !important; display: inline; vertical-align: baseline; line-height: inherit; }
${s} ol li { padding-left: 0.15em; }
${s} li > p { margin: 0 !important; display: block; line-height: inherit; }
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test at src/__tests__/renderer/utils/markdownConfig.test.ts:227-232 expects display: inline; vertical-align: baseline; but now it's display: block - update test expectations

Suggested change
${s} li > p { margin: 0 !important; display: block; line-height: inherit; }
${s} li > p { margin: 0 !important; display: block; line-height: inherit; }

@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Feb 25, 2026

Additional Comments (1)

src/renderer/utils/markdownConfig.ts
generateTerminalProseStyles() still uses display: inline for li > p - consider whether this should also be changed to display: block for consistency with the fix

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/renderer/utils/markdownConfig.ts (1)

128-128: Keep list-paragraph behavior consistent across prose generators.

Line 128 fixes the issue in generateProseStyles, but generateTerminalProseStyles still keeps li > p inline (Line 507), so the same misalignment can still appear in terminal/group-chat markdown.

Suggested parity update in generateTerminalProseStyles
-    ${s} li > p { margin: 0 !important; display: inline; vertical-align: baseline; line-height: inherit; }
+    ${s} ol li { padding-left: 0.15em; }
+    ${s} li > p { margin: 0 !important; display: block; line-height: inherit; }
@@
-    ${s} li::marker { font-weight: normal; }
+    ${s} li::marker { font-weight: normal; }
+    ${s} ol li::marker { font-variant-numeric: tabular-nums; font-weight: 400; }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/renderer/utils/markdownConfig.ts` at line 128,
generateTerminalProseStyles still leaves the selector "li > p" inline causing
list misalignment; mirror the fix from generateProseStyles by updating the "li >
p" rule inside generateTerminalProseStyles to set margin: 0 !important, display:
block, and line-height: inherit (match the exact properties used in
generateProseStyles) so terminal/group-chat markdown renders paragraph children
of list items consistently.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/renderer/utils/markdownConfig.ts`:
- Line 128: generateTerminalProseStyles still leaves the selector "li > p"
inline causing list misalignment; mirror the fix from generateProseStyles by
updating the "li > p" rule inside generateTerminalProseStyles to set margin: 0
!important, display: block, and line-height: inherit (match the exact properties
used in generateProseStyles) so terminal/group-chat markdown renders paragraph
children of list items consistently.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4b01abc and 5c5351e.

📒 Files selected for processing (1)
  • src/renderer/utils/markdownConfig.ts

@pedramamini pedramamini merged commit b89ca7f into RunMaestro:main Feb 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants