Skip to content

Conversation

@Galfurian
Copy link

This PR improves the inline code detection logic in the EnhancedMessageRenderer component to handle cases where the inline prop from react-markdown is undefined.

Changes Made

  • Create an isInlineCode condition in EnhancedMessageRenderer.jsx to include a fallback detection method:
    inline !== false && (!className && !String(children).includes('\n'))

Rationale

The added fallback ensures inline code is correctly identified when:

  • No language class is present (indicating it's not a fenced code block)
  • The content contains no newlines (as inline code should be single-line)

This maintains proper rendering of inline code with appropriate styling while preserving code block functionality. The fix is minimal and backward-compatible.

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.

1 participant