restyle RST option lists (#17637)
* WIP: restyle RST option lists * apply similar style to Latex * fix tests * minor visual tweaks * update tests * remove leftover comments
This commit is contained in:
parent
08262206d3
commit
2150cd1826
7 changed files with 103 additions and 21 deletions
|
|
@ -2085,6 +2085,7 @@ proc parseBulletList(p: var RstParser): PRstNode =
|
|||
proc parseOptionList(p: var RstParser): PRstNode =
|
||||
result = newRstNodeA(p, rnOptionList)
|
||||
let col = currentTok(p).col
|
||||
var order = 1
|
||||
while true:
|
||||
if currentTok(p).col == col and isOptionList(p):
|
||||
var a = newRstNode(rnOptionGroup)
|
||||
|
|
@ -2107,6 +2108,7 @@ proc parseOptionList(p: var RstParser): PRstNode =
|
|||
if currentTok(p).kind == tkIndent: inc p.idx
|
||||
c.add(a)
|
||||
c.add(b)
|
||||
c.order = order; inc order
|
||||
result.add(c)
|
||||
else:
|
||||
if currentTok(p).kind != tkEof: dec p.idx # back to tkIndent
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue