Skip to content

[FEATURE]: Render inline code and code blocks in user messages #12791

Closed as not planned

Description

@bannert1337

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Proposed Feature:
Currently, OpenCode does not render Markdown for inline code (wrapped in single backticks `) or code blocks (wrapped in triple backticks ```) within messages sent by the user. The input is displayed as raw text.

I propose that user messages be parsed and rendered to support:

  • Inline code styling for text between single backticks.
  • Properly formatted code blocks for text between triple backticks, ideally with syntax highlighting.

Use Case:
When discussing code, users frequently paste snippets or refer to specific variables, functions, or file paths.

  • Readability: Rendering variable_names or code blocks makes it much easier to distinguish code from natural language in the chat history.
  • Consistency: It aligns the user's message appearance with the AI's responses, which typically render Markdown, creating a more cohesive chat interface.

Activity

  1. added
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on Feb 9, 2026
  2. github-actions commented on Feb 9, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Feel free to ignore if none of these address your specific case.

  3. expl0r3rgu1 commented on Apr 2, 2026

    @expl0r3rgu1

    I remember they implemented this in an update, but probably reverted it and I didn't even notice in that moment. But I swear it might have been developed and thrown away already.
    Does anyone remember of this feature?

  4. sandikodev commented on Apr 3, 2026

    @sandikodev

    Hi, I'd like to work on this if it's still available. I've looked at the codebase and have a clear implementation plan — modifying HighlightedText in message-part.tsx to parse backtick syntax before rendering. Is anyone currently working on it?

  5. removed
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    webRelates to opencode on web / desktop
    on May 3, 2026
  6. github-actions commented on Jul 3, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions