Skip to content

fix: add paragraph spacing to markdown body for visible line breaks#540

Merged
carlosflorencio merged 1 commit intomainfrom
claude/fix-prompt-line-breaks-fL0SW
Apr 6, 2026
Merged

fix: add paragraph spacing to markdown body for visible line breaks#540
carlosflorencio merged 1 commit intomainfrom
claude/fix-prompt-line-breaks-fL0SW

Conversation

@carlosflorencio
Copy link
Copy Markdown
Member

Summary

  • Tailwind's preflight resets p { margin: 0 }, causing consecutive paragraphs in .markdown-body to render with no visual spacing. This made blank lines in workflow step prompt templates (around {{task_prompt}}) invisible in the chat UI.
  • Added .markdown-body p + p { margin-top: 0.5em } to restore paragraph spacing between consecutive paragraphs. TipTap editor is unaffected (.tiptap p { margin: 0 } takes precedence via source order).
  • Added E2E test verifying consecutive paragraphs have positive computed margin.

Test plan

  • E2E test markdown-paragraph-breaks.spec.ts passes — creates agent message with three paragraphs and asserts marginTop > 0 on consecutive <p> elements
  • Existing markdown-wrap E2E tests still pass (no regression)
  • Manual: create a workflow step with blank lines around {{task_prompt}}, start a task — chat should show visible paragraph spacing
  • Manual: verify TipTap plan editor still renders paragraphs without extra spacing

https://claude.ai/code/session_01Fk9QbebaXKtEcxoD4DRguS

Tailwind's preflight resets p margins to 0, so consecutive paragraphs
in .markdown-body rendered with no visual spacing. This caused blank
lines in workflow step prompt templates (around {{task_prompt}}) to be
invisible in the chat UI. Add `.markdown-body p + p { margin-top: 0.5em }`
to restore paragraph spacing. TipTap editor is unaffected because its
`.tiptap p { margin: 0 }` rule takes precedence via source order.

Includes E2E test verifying consecutive paragraphs have positive margin.

https://claude.ai/code/session_01Fk9QbebaXKtEcxoD4DRguS
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.

carlosflorencio has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 3, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 89cab85f-ae8e-4183-94e3-12d0c17cf8ec

📥 Commits

Reviewing files that changed from the base of the PR and between bccd4d5 and 6df83fe.

📒 Files selected for processing (2)
  • apps/web/app/globals.css
  • apps/web/e2e/tests/chat/markdown-paragraph-breaks.spec.ts

📝 Walkthrough

Summary by CodeRabbit

  • Style

    • Improved vertical spacing between consecutive paragraphs in markdown content for better readability.
  • Tests

    • Added verification test for markdown paragraph rendering behavior.

Walkthrough

CSS rule added to increase vertical spacing between consecutive paragraphs in markdown content by 0.5em. A new end-to-end test validates that the spacing is correctly applied in chat message rendering by inspecting computed DOM styles.

Changes

Cohort / File(s) Summary
Markdown Paragraph Spacing
apps/web/app/globals.css
Added CSS selector rule .markdown-body p + p with margin-top: 0.5em to increase vertical spacing between consecutive paragraphs.
Paragraph Spacing Test
apps/web/e2e/tests/chat/markdown-paragraph-breaks.spec.ts
New Playwright E2E test that verifies markdown paragraph spacing in chat by creating a task with multi-paragraph content, navigating to the session page, and asserting that consecutive paragraph pairs have positive computed top margins via DOM inspection.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 hop hop — Space between words, space between lines,
Our paragraphs breathe with 0.5em designs!
A test to ensure the margins are true,
Markdown prose now has room for its view. ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description covers the problem, solution, and testing approach, but is presented as bullet points rather than following the required template structure with proper sections. Reformat to follow the template: add a Summary section at the top as prose (no heading), and organize Validation steps under a Validation heading for clarity.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title directly summarizes the main change: adding paragraph spacing to markdown body CSS to fix invisible line breaks.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/fix-prompt-line-breaks-fL0SW

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@carlosflorencio carlosflorencio merged commit a704f4b into main Apr 6, 2026
23 checks passed
@carlosflorencio carlosflorencio deleted the claude/fix-prompt-line-breaks-fL0SW branch April 6, 2026 08:01
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