rst: fix bug 20 from #17340 (#18360)

and a leftover bug: priority of option list inside definition list
This commit is contained in:
Andrey Makarov 2021-06-26 19:10:46 +03:00 • committed by GitHub
commit 1b9b806007
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 50 additions and 1 deletions

View file

@ -2245,7 +2245,7 @@ proc parseOptionList(p: var RstParser): PRstNode =
popInd(p)
else:
parseLine(p, b)
if currentTok(p).kind == tkIndent: inc p.idx
while currentTok(p).kind == tkIndent: inc p.idx
c.add(a)
c.add(b)
c.order = order; inc order
@ -2262,6 +2262,8 @@ proc parseDefinitionList(p: var RstParser): PRstNode =
var col = currentTok(p).col
result = newRstNodeA(p, rnDefList)
while true:
if isOptionList(p):
break # option list has priority over def.list
j = p.idx
var a = newRstNode(rnDefName)
parseLine(p, a)