Skip to content

Commit

Permalink
Remove whitespace inside rendered code <td> (#17859)
Browse files Browse the repository at this point in the history
This extra whitespace caused isses in Firefox where it would copy a
extra space character at the start and the end. Additionally, in Chrome,
the text selection indicated a spaced on the end of the selection where
there was none. Both issues are fixed with the removal of whitespace.
  • Loading branch information
silverwind committed Nov 29, 2021
1 parent 830ab75 commit 4a6bd60
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions templates/repo/view_file.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,8 @@
{{range $idx, $code := .FileContent}}
{{$line := Add $idx 1}}
<tr>
<td id="L{{$line}}" class="lines-num">
<span id="L{{$line}}" data-line-number="{{$line}}"></span>
</td>
<td rel="L{{$line}}" class="lines-code chroma">
<code class="code-inner">{{$code | Safe}}</code>
</td>
<td id="L{{$line}}" class="lines-num"><span id="L{{$line}}" data-line-number="{{$line}}"></span></td>
<td rel="L{{$line}}" class="lines-code chroma"><code class="code-inner">{{$code | Safe}}</code></td>
</tr>
{{end}}
</tbody>
Expand Down

0 comments on commit 4a6bd60

Please sign in to comment.