Skip to content

fix(assistant): render markdown in TextInput output#540

Open
n-iv wants to merge 1 commit into
nextcloud:mainfrom
n-iv:fix/render-markdown-in-assistant-output
Open

fix(assistant): render markdown in TextInput output#540
n-iv wants to merge 1 commit into
nextcloud:mainfrom
n-iv:fix/render-markdown-in-assistant-output

Conversation

@n-iv
Copy link
Copy Markdown

@n-iv n-iv commented May 13, 2026

Summary

The assistant's "generate text" form currently displays its output through NcRichContenteditable, which renders text as-is. When the underlying LLM returns markdown (heading, lists, tables, bold, links), the user sees raw markdown syntax instead of formatted content.

This PR wraps the output field in NcRichText when isOutput is true, falling back to NcRichContenteditable for the input case. Headings, lists, bold, italic, code blocks and links are now rendered. Tables are not rendered due to the markdown-it configuration of NcRichText in @nextcloud/vue, which does not enable the table plugin by default. The copy still functions and keeps the markdown as expected.

Screenshots

Before
Screenshot_20260513_102348

After
Screenshot_20260513_130308

Wrap the output field in NcRichText when isOutput is true, falling back to NcRichContenteditable for the input case. Headings, lists, bold, italic, code blocks and links are now rendered. Tables are not rendered due to the markdown-it configuration of NcRichText in @nextcloud/vue, which does not enable the table plugin by default. The copy still functions and keeps the markdown as expected.

Signed-off-by: niv <nicolas.varlot@ac-versailles.fr>
Copilot AI review requested due to automatic review settings May 13, 2026 12:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Renders markdown content in the assistant's "generate text" output by using NcRichText for output mode while keeping NcRichContenteditable for input mode.

Changes:

  • Conditionally render NcRichText when isOutput && hasValue is true.
  • Import and register the NcRichText component.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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