Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 15, 2026
Contributor
|
Can you rebase? |
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.
Fenced code blocks in commit bodies (added in #124) now render through the
CodeHighlighterthat #153 introduced for snippets, so there is one code-rendering path instead of two. Body blocks gain a language label and a copy button, the change hardens code-block rendering, and the code theme is tuned for contrast.Summary
CodeSpans::block()highlights throughCodeHighlighterinstead of callingtempest/highlightdirectly.CodeBlockcomponent (label + copy), the same one snippets use.js,ts,yml,sh,console, …) map to the snippet languages;SnippetLanguagegains aTerminalcase andtryFromName(). A fence the app doesn't know keeps its own name as the label.level: max.Why this design
#124 highlighted body blocks on their own code path, next to the one snippets use since #153. Routing body blocks through
CodeHighlightermeans:CodeSpansno longer depends onTempest\Highlight\Highlighter; it callsCodeHighlighter::highlight(), which both snippets and body blocks now share, including its cache.CodeBlock(language label, copy of the raw code), so a block in a body and a snippet card look and behave alike.What's included
CodeSpans::block()resolves the fence's language throughSnippetLanguage::tryFromName()(name or alias, any case) and highlights throughCodeHighlighter. An unknown fence is labelled with its own name and left unhighlighted; a bare fence is plain text. Each block segment now carrieslanguage_label,code(raw, for copying) and validatedhtml.SnippetLanguage::tryFromName()mapsjs/node,ts,py,yml,sh/shell,console/term,tf/hcl, and others to their language; a newTerminalcase covers shell session transcripts.commit-body.tsxrenders each block with<CodeBlock>instead of its own markup, passingcode,htmlandlanguageLabel.hl-*token colors move to--code-*CSS variables, with light-mode values darkened to read at 4.5:1 or more on the muted block background, and separate dark-mode values.jsblock, label + CopyMobile (390px):
jsblock light / dark; plain block light / dark.Performance & security
Testing
40 tests added (1262 → 1302), 100% line and type coverage, PHPStan
level: max.CommitCodeBlockTest: a block is labelled by its fence (name or alias), an unknown fence keeps its name and stays unhighlighted, a bare fence is plain text, and the raw code travels beside the escaped HTML for copying.CodeSpansTest: alias mapping across the languages, the language label and raw code on each segment, and a fallback to escaped plain code when the highlighter output is not clean.CommitControllerTest: the body segments of a commit with a code block carry the label and raw code.Related work
CodeHighlighterandCodeBlockadded there.Notes for reviewers
jsblock still highlights as before, now with a label and a copy button and a slightly higher-contrast theme.🤖 Generated with Claude Code