summary refs log tree commit diff stats
path: root/lib/packages
diff options
context:
space:
mode:
authorAndrey Makarov <ph.makarov@gmail.com>2020-12-29 05:32:11 +0300
committerGitHub <noreply@github.com>2020-12-29 03:32:11 +0100
commite70ac0f34c9f195f6e423b3ac7e54b912e62c71d (patch)
tree52db4b97a36fdebcebf17f47e9820a5d7c996bcc /lib/packages
parent6d442a40a6f89572052d61aeb73ec26d1f3451ce (diff)
downloadNim-e70ac0f34c9f195f6e423b3ac7e54b912e62c71d.tar.gz
RST: fix directive with fields (#16490) (#16493)
* RST: fix directive with fields (#16490)

* Update tests/stdlib/trstgen.nim

Co-authored-by: Clyybber <darkmine956@gmail.com>
Diffstat (limited to 'lib/packages')
-rw-r--r--lib/packages/docutils/rst.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/packages/docutils/rst.nim b/lib/packages/docutils/rst.nim
index 7dbcaf482..698d76da1 100644
--- a/lib/packages/docutils/rst.nim
+++ b/lib/packages/docutils/rst.nim
@@ -1737,7 +1737,8 @@ proc parseDirective(p: var RstParser, flags: DirFlags,
   ##
   ## .. warning:: Any of the 3 children may be nil.
   result = parseDirective(p, flags)
-  if not isNil(contentParser):
+  if not isNil(contentParser) and
+      (currentTok(p).kind != tkIndent or indFollows(p)):
     var nextIndent = p.tok[tokenAfterNewline(p)-1].ival
     if nextIndent <= currInd(p):  # parse only this line
       nextIndent = currentTok(p).col