Render markdown in Vue chat TextContent#730
Open
shogun444 wants to merge 2 commits into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #728
What
The Vue chat example claims that
TextContentsupports 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
TextContentto render markdown as the prompt already describes.Changes
TextContentusingmarkedDOMPurifyv-htmlmarkedanddompurifyas direct dependencies for the Vue chat exampleWhy
The issue proposed two possible fixes:
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-chatonly. No changes were made to@openuidev/vue-langsince the runtime is functioning correctly; the issue was limited to the example's rendering implementation.Test Plan
DOMPurify)Checklist