Skip to content

fix: add explicit styling for markdown strong and em elements#806

Open
caoergou wants to merge 1 commit intodifferent-ai:devfrom
caoergou:fix/markdown-bold-em-styling-802
Open

fix: add explicit styling for markdown strong and em elements#806
caoergou wants to merge 1 commit intodifferent-ai:devfrom
caoergou:fix/markdown-bold-em-styling-802

Conversation

@caoergou
Copy link
Contributor

@caoergou caoergou commented Mar 9, 2026

Summary

Adds explicit Tailwind CSS utility classes for <strong> and <em> elements in markdown content rendering.

Problem

Markdown bold syntax (**text**) was not visually rendered as bold in AI assistant chat messages. The <strong> tags were correctly generated by the marked library, but Tailwind CSS v4 sets font-weight: bolder by default, which is a relative value that may not produce visible bold effect depending on the parent element's font weight.

Solution

Added explicit styling in part-view.tsx:

  • [&_strong]:font-semibold - ensures bold text renders with font-weight: 600
  • [&_em]:italic - ensures italic text renders correctly

Testing

  1. Ask AI to respond with bold text: 请回复:这是 **加粗文字** 测试
  2. Verify that the bold text is now visually distinct

Fixes #802

Tailwind CSS v4 sets `font-weight: bolder` for <strong> by default,
which is a relative value that may not produce visible bold effect
depending on the parent element's font weight.

This commit adds explicit Tailwind utility classes to ensure:
- <strong> elements render with font-semibold (font-weight: 600)
- <em> elements render with italic style

Fixes different-ai#802
@vercel
Copy link

vercel bot commented Mar 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openwork-software Ready Ready Preview, Comment Mar 9, 2026 3:16am

@vercel
Copy link

vercel bot commented Mar 9, 2026

@caoergou is attempting to deploy a commit to the Different AI Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2026

The following comment was made by an LLM, it may be inaccurate:

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.

Bug: Markdown bold syntax (**text**) not rendering correctly in chat messages

1 participant