fix rst option list at EOF (follow-up #17442) (#17638)

This commit is contained in:
Andrey Makarov 2021-04-04 21:54:26 +03:00 • committed by GitHub
commit f02e159b56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -2067,7 +2067,7 @@ proc parseOptionList(p: var RstParser): PRstNode =
c.add(b) c.add(b)
result.add(c) result.add(c)
else: else:
dec p.idx # back to tkIndent if currentTok(p).kind != tkEof: dec p.idx # back to tkIndent
break break
proc parseDefinitionList(p: var RstParser): PRstNode = proc parseDefinitionList(p: var RstParser): PRstNode =

View file

@ -1362,6 +1362,7 @@ Test1
output) output)
check("""<th align="left">-d</th><td align="left">option</td>""" in check("""<th align="left">-d</th><td align="left">option</td>""" in
output) output)
check "<p>option</p>" notin output
test "Option list 3 (double /)": test "Option list 3 (double /)":
let input = dedent """ let input = dedent """
@ -1378,6 +1379,7 @@ Test1
output) output)
check("""<th align="left">-d</th><td align="left">option</td>""" in check("""<th align="left">-d</th><td align="left">option</td>""" in
output) output)
check "<p>option</p>" notin output
test "Roles: subscript prefix/postfix": test "Roles: subscript prefix/postfix":
let expected = "See <sub>some text</sub>." let expected = "See <sub>some text</sub>."