Skip to content

Commit

Permalink
fix rst option list at EOF (follow-up #17442) (#17638)
Browse files Browse the repository at this point in the history
  • Loading branch information
a-mr authored Apr 4, 2021
1 parent 97764c8 commit f02e159
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/packages/docutils/rst.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2067,7 +2067,7 @@ proc parseOptionList(p: var RstParser): PRstNode =
c.add(b)
result.add(c)
else:
dec p.idx # back to tkIndent
if currentTok(p).kind != tkEof: dec p.idx # back to tkIndent
break

proc parseDefinitionList(p: var RstParser): PRstNode =
Expand Down
2 changes: 2 additions & 0 deletions tests/stdlib/trstgen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1362,6 +1362,7 @@ Test1
output)
check("""<th align="left">-d</th><td align="left">option</td>""" in
output)
check "<p>option</p>" notin output

test "Option list 3 (double /)":
let input = dedent """
Expand All @@ -1378,6 +1379,7 @@ Test1
output)
check("""<th align="left">-d</th><td align="left">option</td>""" in
output)
check "<p>option</p>" notin output

test "Roles: subscript prefix/postfix":
let expected = "See <sub>some text</sub>."
Expand Down

0 comments on commit f02e159

Please sign in to comment.