Repository navigation
Conversation
|
Warning Amazon Q Developer for GitHub: end of support On January 30, 2027, AWS will discontinue support for the Amazon Q Developer for GitHub App. New app installations will no longer be available starting November 18, 2026. For capabilities similar to the Amazon Q Developer for GitHub App, explore Kiro and the Kiro GitHub App. For more information about the end of support, see Amazon Q Developer end-of-support announcement on the AWS DevOps Blog. |
There was a problem hiding this comment.
Review Summary
This PR migrates ASM block highlighting from HLJS to custom Prism grammars (x86asm, armasm-objdump, radare2) and cleans up the renderer accordingly. The approach is correct in structure, but there are two blocking logic bugs:
1. MarkdownRenderer.jsx — Custom languages registered on the wrong instance
PrismLight and PrismHighlighter are distinct instances from react-syntax-highlighter. Registering languages on PrismLight while rendering with PrismHighlighter means the custom languages are invisible to the renderer, so all three custom language blocks will silently fall back to plain-text highlighting. The fix is to alias PrismLight as PrismHighlighter (using only the light bundle), or register languages on PrismHighlighter instead.
2. radare2.js — r2-comment-variable rule is dead code due to ordering
Prism grammars are order-sensitive: the r2-variable rule is declared before r2-comment-variable and its pattern will always match first on the same input prefix (; arg/; var), leaving r2-comment-variable unreachable. Moving r2-comment-variable above r2-variable will restore its intended behavior.
Both issues need to be resolved before merging.
You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.
| import 'katex/dist/katex.min.css'; | ||
| import { Prism as PrismHighlighter } from 'react-syntax-highlighter'; | ||
| import { Light as HLJSHighlighter } from 'react-syntax-highlighter'; | ||
| import { Prism as PrismHighlighter, PrismLight } from 'react-syntax-highlighter'; |
There was a problem hiding this comment.
🛑 Logic Error: PrismLight and PrismHighlighter are two separate instances — custom languages registered on PrismLight are not available to PrismHighlighter. The PrismCodeBlock component uses PrismHighlighter for rendering, so it will never find x86asm, armasm-objdump, or radare2, causing those blocks to fall back to plain text. Either register languages on PrismHighlighter directly, or switch the renderer component to PrismLight as well.
| import { Prism as PrismHighlighter, PrismLight } from 'react-syntax-highlighter'; | |
| import { PrismLight as PrismHighlighter } from 'react-syntax-highlighter'; |
| 'r2-comment-variable': { | ||
| pattern: /; (?:arg|var)\w+[^;\n]*/, | ||
| alias: 'ansi-blue', | ||
| }, |
There was a problem hiding this comment.
🛑 Logic Error: r2-comment-variable (line 57–60) is ordered after r2-variable (line 43–56) in the grammar object. Prism evaluates rules in declaration order, so r2-variable with pattern /; (?:arg|var) .*/ will consume any matching ;arg/;var comment lines first, making r2-comment-variable unreachable dead code that never matches. Move r2-comment-variable before r2-variable to give it priority.
No description provided.