Repository navigation
feat: inline code and highlighted code blocks in commits - #124
Merged
Merged
Conversation
mnapoli
force-pushed
the
feat/code-highlighting
branch
from
October 15, 2026 18:01
767ce75 to
e93f729
Compare
Commits and replies now render `inline code` and fenced code blocks, highlighted server-side with tempest/highlight. Blocks are highlighted when they name a supported language; other blocks render as escaped plain code. Emoji shortcodes, link previews and mentions skip code.
mnapoli
force-pushed
the
feat/code-highlighting
branch
from
October 15, 2026 18:04
e93f729 to
5943063
Compare
This was referenced Oct 15, 2026
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.
Commits and replies now render
inline codeand fenced code blocks. Blocks are syntax highlighted on the server with tempest/highlight.How it works
CodeSpansservice splits a body into prose and code. A block is a line starting withor more backticks, an optional language, and a closing line ofor more; inline code is a single-line`…`. Unclosed code stays plain text.CodeSpans::highlight()turns the body into text, inline-code and block segments. Commits now carry these asbody_segments, added inCommit::toArray(). The service is#[Scoped], so a page of commits shares one highlighter.CommitBodycomponent replaces the body paragraph in the commit card and thread replies. Only blocks inject HTML, and the highlighter escapes the code first. Text segments still go throughLinkifiedTextandemojify..hl-*classes inapp.cssuse the app's own colours (primary, lanes, muted), so light and dark mode both work.Languages
Only languages tempest/highlight supports get colours: PHP, JS/TS, Python, Bash, SQL, CSS/SCSS, HTML, JSON, YAML, Blade, Twig, Vue, Svelte, Diff and more. The language name is case-insensitive. A block without a language, or with one tempest doesn't know, shows as escaped plain code; there is no auto-detection or fallback. Blocks show the language label as written.
Code is left alone
:fire) are not replaced inside code, both when the commit is saved and in the composer while typing.@mentionsin code (@Override,@param) don't notify anyone.Not changed
The OG image, meta description, notifications, flash toast and "who to follow" suggestions still show the raw body.