and a leftover bug: priority of option list inside definition list
This commit is contained in:
parent
b8f761b7e2
commit
1b9b806007
2 changed files with 50 additions and 1 deletions
|
|
@ -83,6 +83,53 @@ suite "RST parsing":
|
|||
rnLeaf 'set'
|
||||
""")
|
||||
|
||||
test "items of 1 option list can be separated by blank lines":
|
||||
check(dedent"""
|
||||
-a desc1
|
||||
|
||||
-b desc2
|
||||
""".toAst ==
|
||||
dedent"""
|
||||
rnOptionList
|
||||
rnOptionListItem order=1
|
||||
rnOptionGroup
|
||||
rnLeaf '-'
|
||||
rnLeaf 'a'
|
||||
rnDescription
|
||||
rnLeaf 'desc1'
|
||||
rnOptionListItem order=2
|
||||
rnOptionGroup
|
||||
rnLeaf '-'
|
||||
rnLeaf 'b'
|
||||
rnDescription
|
||||
rnLeaf 'desc2'
|
||||
""")
|
||||
|
||||
test "option list has priority over definition list":
|
||||
check(dedent"""
|
||||
defName
|
||||
defBody
|
||||
|
||||
-b desc2
|
||||
""".toAst ==
|
||||
dedent"""
|
||||
rnInner
|
||||
rnDefList
|
||||
rnDefItem
|
||||
rnDefName
|
||||
rnLeaf 'defName'
|
||||
rnDefBody
|
||||
rnInner
|
||||
rnLeaf 'defBody'
|
||||
rnOptionList
|
||||
rnOptionListItem order=1
|
||||
rnOptionGroup
|
||||
rnLeaf '-'
|
||||
rnLeaf 'b'
|
||||
rnDescription
|
||||
rnLeaf 'desc2'
|
||||
""")
|
||||
|
||||
test "RST comment":
|
||||
check(dedent"""
|
||||
.. comment1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue