opencode icon indicating copy to clipboard operation
opencode copied to clipboard

feat: Markdown rendering for user messages

Open jtyr opened this issue 4 months ago • 6 comments

I'm using Markdown a lot and I'm a little bit sad that OpenCode doesn't render my Markdown-typed messages as Markdown. I have tried to fix it in this PR.

There is one caveat - the highlighting for files and agents is omitted because it breaks the Markdown. Personally I would prefer to have my messages rendered as Markdown than have the references to files and agents highlighted. The feature is disable by default so it doesn't not impact the current user experience in any way.

jtyr avatar Aug 28 '25 23:08 jtyr

@thdxr @jayair @rekram1-node Please can you review this PR?

jtyr avatar Aug 30 '25 21:08 jtyr

I think this is mostly up to Adam, tui features are his domain

rekram1-node avatar Aug 30 '25 21:08 rekram1-node

main issue with this is that the markdown rendering swallows html tags and other random stuff people add to their prompts (__init__.py), we originally did this and got a bunch of complaints. can revisit with opentui.

adamdotdevin avatar Aug 31 '25 00:08 adamdotdevin

any chance this gets another look?

iamhenry avatar Nov 18 '25 04:11 iamhenry

this pr would prolly need a refresher and then we can look at it.

rekram1-node avatar Nov 18 '25 05:11 rekram1-node

The solution in this PR is not very good. I think it would be better to address it somehow in the OpenTUI as suggested above.

jtyr avatar Nov 18 '25 17:11 jtyr