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>
This commit is contained in:
parent
a45909be90
commit
245457d4d3
3 changed files with 9 additions and 6 deletions
|
@ -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())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue