Rst test check messages (fix #17280) (#17338)

This commit is contained in:
Andrey Makarov 2021-03-17 22:13:04 +03:00 • committed by GitHub
commit 4bfc5a9551
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 155 additions and 89 deletions

View file

@ -25,6 +25,7 @@ from std/private/globs import nativeToUnixPath
const
exportSection = skField
docCmdSkip = "skip"
DocColOffset = "## ".len # assuming that a space was added after ##
type
TSections = array[TSymKind, Rope]
@ -322,8 +323,12 @@ proc genComment(d: PDoc, n: PNode): string =
when false:
# RFC: to preseve newlines in comments, this would work:
comment = comment.replace("\n", "\n\n")
renderRstToOut(d[], parseRst(comment, toFullPath(d.conf, n.info), toLinenumber(n.info),
toColumn(n.info), (var dummy: bool; dummy), d.options, d.conf), result)
renderRstToOut(d[],
parseRst(comment, toFullPath(d.conf, n.info),
toLinenumber(n.info),
toColumn(n.info) + DocColOffset,
(var dummy: bool; dummy), d.options, d.conf),
result)
proc genRecCommentAux(d: PDoc, n: PNode): Rope =
if n == nil: return nil