Skip to content

Render markdown in Vue chat TextContent#730

Open
shogun444 wants to merge 2 commits into
thesysdev:mainfrom
shogun444:fix/vue-chat-textcontent-markdown-728
Open

Render markdown in Vue chat TextContent#730
shogun444 wants to merge 2 commits into
thesysdev:mainfrom
shogun444:fix/vue-chat-textcontent-markdown-728

Conversation

@shogun444

@shogun444 shogun444 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Fixes #728

What

The Vue chat example claims that TextContent supports markdown, but the component rendered text using plain Vue interpolation, causing markdown syntax (e.g. **NVDA**) to appear literally instead of being formatted.

This PR updates TextContent to render markdown as the prompt already describes.

Changes

  • Parse TextContent using marked
  • Sanitize the generated HTML with DOMPurify
  • Render the sanitized HTML using v-html
  • Add marked and dompurify as direct dependencies for the Vue chat example

Why

The issue proposed two possible fixes:

  • Render markdown correctly
  • Remove markdown support from the prompt

This PR chooses the first approach so the implementation matches the documented behavior instead of reducing functionality.

The change is intentionally scoped to examples/vue-chat only. No changes were made to @openuidev/vue-lang since the runtime is functioning correctly; the issue was limited to the example's rendering implementation.

Test Plan

  • Plain text rendering is unchanged
  • HTML is sanitized before rendering (DOMPurify)

Checklist

  • I linked a related issue
  • I considered backwards compatibility
  • No documentation changes required

shogun444 added 2 commits July 7, 2026 16:50
TextContent's prompt/description claims markdown support, but the
component rendered text with plain interpolation, showing literal
markdown syntax (e.g. **NVDA**) instead of formatted output. Parse
text with marked and sanitize with DOMPurify before binding via
v-html.

Scoped to examples/vue-chat only; @openuidev/vue-lang runtime is
unchanged.

Fixes thesysdev#728
Adds the lockfile entries for the marked/dompurify dependencies
added to examples/vue-chat/package.json in the previous commit, so
pnpm install --frozen-lockfile (CI) matches the package.json specs.
Both packages were already fully resolved elsewhere in the lockfile
as transitive deps, so this only adds the importer specifiers for
examples/vue-chat.
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.

Vue chat TextContent claims markdown support but renders markdown literally

1 participant