diff options
author | Andrey Nering <andrey.nering@gmail.com> | 2016-01-31 14:19:02 -0200 |
---|---|---|
committer | Andrey Nering <andrey.nering@gmail.com> | 2016-02-04 18:21:47 -0200 |
commit | 2bfb8bb5fdebb4ae02c83a271e8eb24bc68afec1 (patch) | |
tree | 5d09fae4e0f0be52ec38437070433623c89f7006 /templates | |
parent | 137a49e8342ab207c8570fc18b7c81b5fa9789ab (diff) | |
download | gitea-2bfb8bb5fdebb4ae02c83a271e8eb24bc68afec1.tar.gz gitea-2bfb8bb5fdebb4ae02c83a271e8eb24bc68afec1.zip |
Enable sintax highlighting on diff view. Close #733
Diffstat (limited to 'templates')
-rw-r--r-- | templates/repo/diff_box.tmpl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/templates/repo/diff_box.tmpl b/templates/repo/diff_box.tmpl index 4ea531c3c5..f96ebda52d 100644 --- a/templates/repo/diff_box.tmpl +++ b/templates/repo/diff_box.tmpl @@ -76,13 +76,13 @@ <span rel="{{if $line.LeftIdx}}diff-{{Sha1 $file.Name}}L{{$line.LeftIdx}}{{end}}">{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}</span> </td> <td class="lines-code halfwidth"> - <pre class="wrap">{{if $line.LeftIdx}}{{$section.GetComputedInlineDiffFor $line}}{{end}}</pre> + <pre><code class="wrap {{if $file.GetHighlightClass}}language-{{$file.GetHighlightClass}}{{else}}nohighlight{{end}}">{{if $line.LeftIdx}}{{$section.GetComputedInlineDiffFor $line}}{{end}}</code></pre> </td> <td class="lines-num lines-num-new"> <span rel="{{if $line.RightIdx}}diff-{{Sha1 $file.Name}}R{{$line.RightIdx}}{{end}}">{{if $line.RightIdx}}{{$line.RightIdx}}{{end}}</span> </td> <td class="lines-code halfwidth"> - <pre class="wrap">{{if $line.RightIdx}}{{$section.GetComputedInlineDiffFor $line}}{{end}}</pre> + <pre><code class="wrap {{if $file.GetHighlightClass}}language-{{$file.GetHighlightClass}}{{else}}nohighlight{{end}}">{{if $line.RightIdx}}{{$section.GetComputedInlineDiffFor $line}}{{end}}</code></pre> </td> </tr> {{end}} @@ -104,7 +104,7 @@ </td> {{end}} <td class="lines-code"> - <pre>{{$section.GetComputedInlineDiffFor $line}}</pre> + <pre><code class="{{if $file.GetHighlightClass}}language-{{$file.GetHighlightClass}}{{else}}nohighlight{{end}}">{{$section.GetComputedInlineDiffFor $line}}</code></pre> </td> </tr> {{end}} |