summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorjaqra <48099350+jaqra@users.noreply.github.com>2019-08-28 01:59:05 +0300
committerAntoine GIRARD <sapk@users.noreply.github.com>2019-08-28 00:59:05 +0200
commit245457d4d3403db9081bf00f8849546630ae45af (patch)
tree3cd0fc89633556b4dbc740b52649b99b32707c01 /routers
parenta45909be90b6c553d572eb81bd61e445ae379439 (diff)
downloadgitea-245457d4d3403db9081bf00f8849546630ae45af.tar.gz
gitea-245457d4d3403db9081bf00f8849546630ae45af.zip
Move line number to :before attr to hide from search on browser (#8002)
* Move line number to :before attr to hide from search on browser * Use same variable in WriteString Co-Authored-By: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'routers')
-rw-r--r--routers/repo/view.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/repo/view.go b/routers/repo/view.go
index 9d24506b47..00790a4ef3 100644
--- a/routers/repo/view.go
+++ b/routers/repo/view.go
@@ -319,7 +319,7 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st
output.Reset()
for i := 0; i < len(lines); i++ {
- output.WriteString(fmt.Sprintf(`<span id="L%d">%d</span>`, i+1, i+1))
+ output.WriteString(fmt.Sprintf(`<span id="L%[1]d" data-line-number="%[1]d"></span>`, i+1))
}
ctx.Data["LineNums"] = gotemplate.HTML(output.String())
}