diff options
author | Unknwon <u@gogs.io> | 2017-02-20 16:16:32 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2017-02-20 16:16:32 -0500 |
commit | 934734a85a1e4cb68d8c1aa68c518b511c7be190 (patch) | |
tree | 775db872acad5e2ff4ef9ed837870907d8864455 /templates/repo/diff | |
parent | 491934784fd99c10a4d2cb37eabb94d3c4ef1903 (diff) |
diff: able to highlight line with hashtag URL
Diffstat (limited to 'templates/repo/diff')
-rw-r--r-- | templates/repo/diff/section_unified.tmpl | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/templates/repo/diff/section_unified.tmpl b/templates/repo/diff/section_unified.tmpl index ee66b6dc..f5ea81f1 100644 --- a/templates/repo/diff/section_unified.tmpl +++ b/templates/repo/diff/section_unified.tmpl @@ -8,14 +8,18 @@ {{/* {{if gt $j 0}}<span class="fold octicon octicon-fold"></span>{{end}} */}} </td> {{else}} - <td class="lines-num lines-num-old"> - <span rel="{{if $line.LeftIdx}}diff-{{Sha1 $file.Name}}L{{$line.LeftIdx}}{{end}}">{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}</span> + <td class="lines-num lines-num-old" {{if $line.LeftIdx}}id="diff-{{$file.Index}}L{{$line.LeftIdx}}"{{end}}> + {{if $line.LeftIdx}} + <span>{{$line.LeftIdx}}</span> + {{end}} </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 class="lines-num lines-num-new" {{if $line.RightIdx}}id="diff-{{$file.Index}}R{{$line.RightIdx}}"{{end}}> + {{if $line.RightIdx}} + <span>{{$line.RightIdx}}</span> + {{end}} </td> {{end}} - <td class="lines-code"> + <td class="lines-code" rel=""> <pre><code class="{{if $highlightClass}}language-{{$highlightClass}}{{else}}nohighlight{{end}}">{{$section.GetComputedInlineDiffFor $line}}</code></pre> </td> </tr> |