Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Clone

Read only, no credentials:

https://rodent.software/git/vole.git

Write over SSH with a registered key:

git clone ssh://git@0.0.0.0:2222/vole.git

A free and open-source forge that lives in your Git repo.

Highlight syntax in diff views

e7982ac5137be6e891616cdcdedc035f9019f99b · Keenan Nemetz · 12d ago · parent a76b2f38

Highlight syntax in diff views

The diff parser now names each file's Prism language from the new path (or the old path for a deletion), and the shared diff template carries that language plus the side of every line. app.js queues a diff once per side, so an old-side string or comment cannot colour new-side lines, and the token palette now covers diff cells as well as blobs.

The commit, compare, and change-request Files views all use the same template, so they gain highlighting together.

server/web_test.go +8−3

@@ -43,10 +43,15 @@ func TestCommitPageShowsThePatch(t *testing.T) {
43 43 }
44 44 }
45 45 // Added and removed lines are marked as such, not just printed: the colour
46 // and the numbering both hang off these classes.
47 for _, want := range []string{`class="add"`, `class="del"`} {
46 // and the numbering both hang off these classes. Each diff also names its
47 // language and the side each line belongs to, so the worker can highlight the
48 // old and new streams without letting one colour the other.
49 for _, want := range []string{
50 `class="add"`, `class="del"`,
51 `data-highlight="markdown"`, `data-highlight-side="old"`, `data-highlight-side="new"`,
52 } {
48 53 if !strings.Contains(body, want) {
49 t.Fatalf("commit page has no %s row:\n%s", want, body)
54 t.Fatalf("commit page has no %s marker:\n%s", want, body)
50 55 }
51 56 }
52 57 // The subject links back from the commit list, so the page is reachable by