Conversation
sabhi128
requested review from
hiveer,
ice201508,
jialudev,
ymh6315431,
yoiteyou and
zhendi
as code owners
September 17, 2026 14:56
There was a problem hiding this comment.
🟡 Changes recommended
Address the critical XSS risk and the malformed nested code-block markup.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Enhances Markdown code blocks with syntax badges, a header copy toolbar, and styled containers.
Changes:
- Adds language labels with a
CODEfallback. - Moves copy controls into the header toolbar.
- Adds rendering tests for badges and toolbar output.
File summaries
| File | Description |
|---|---|
frontend/src/components/shared/viewers/MarkdownViewer.vue |
Adds code block headers, badges, copy controls, and styling. |
frontend/src/components/__tests__/shared/viewers/MarkdownViewer.spec.js |
Tests toolbar and language-label rendering. |
Review details
Suppressed comments (1)
frontend/src/components/shared/viewers/MarkdownViewer.vue:65
highlightis a markdown-it highlight hook, so returning a string that does not start with<premakes markdown-it wrap it in its own<pre><code>...</code></pre>. This produces nested<pre><code><div class="code-block-container">...markup, leaving the toolbar inside the code element instead of creating the intended card structure. Use a customrenderer.rules.fenceimplementation for the complete card, or return a complete<pre>from this hook.
return `<div class="code-block-container my-3 rounded-md border border-gray-200 overflow-hidden shadow-xs">${codeHeader}<pre class="!m-0 !p-3 !bg-gray-50 !overflow-x-auto"><code class="hl-code !leading-6 !text-sm">${highlightedCode}</code></pre></div>`
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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 of Changes
This PR enhances the code block rendering experience in
MarkdownViewer.vueby adding an integrated toolbar featuring syntax language badges and an accessible copy button.Key Enhancements:
python,bash,json,yaml) and renders an uppercase badge in the header toolbar (PYTHON,BASH, etc.).frontend/src/components/__tests__/shared/viewers/MarkdownViewer.spec.jsasserting proper toolbar rendering and language badge generation.