feat(chat): add syntax highlighting for markdown code blocks#63
Open
kathifis wants to merge 7 commits into
Open
feat(chat): add syntax highlighting for markdown code blocks#63kathifis wants to merge 7 commits into
kathifis wants to merge 7 commits into
Conversation
|
APIError: Quota exceeded. Check your plan and billing details. |
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.
Summary (Sub-issue #62)
Follow-up to Markdown rendering in chat. Fenced code blocks with a language tag (e.g.
```js) are now syntax-highlighted in chat messages.highlight.js(core + selected languages) for lightweight highlightingmarkdownHighlight.tsutility: custommarkedcode renderer, highlight, then DOMPurify sanitize`like this`) is not highlightedThis branch builds on the Markdown rendering work (
MarkdownRenderer, copy button,env.d.ts). If the parent Markdown PR is not merged yet, merge that first or review this PR as the combined chat-markdown stack.Library choice
highlight.jswithlib/coreand explicit language imports (js/ts, python, json, xml, css, bash, sql) — smaller bundle than importing the full package.Acceptance criteria
highlight.js).hljstheme)DOMPurify,ADD_ATTR: ['class'])Changed files
package.jsonhighlight.jsdependencysrc/utils/markdownHighlight.tssrc/components/chat/MarkdownRenderer.vuesrc/__tests__/markdownHighlight.test.tssrc/__tests__/markdownRenderer.component.test.ts