mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 22:10:33 +00:00
Make countLines() the same as len(splitLines(s)) (#5470)
The result of countLines() is now increased by 1 compared to the old version. Fixes #5460.
This commit is contained in:
committed by
Andreas Rumpf
parent
f7af16a1c9
commit
a42801d100
@@ -870,7 +870,7 @@ proc buildLinesHTMLTable(d: PDoc; params: CodeBlockParams, code: string):
|
||||
d.config.getOrDefault"doc.listing_end" % id)
|
||||
return
|
||||
|
||||
var codeLines = 1 + code.strip.countLines
|
||||
var codeLines = code.strip.countLines
|
||||
assert codeLines > 0
|
||||
result.beginTable = """<table class="line-nums-table"><tbody><tr><td class="blob-line-nums"><pre class="line-nums">"""
|
||||
var line = params.startLine
|
||||
|
||||
Reference in New Issue
Block a user