diff options
author | Andrey Makarov <ph.makarov@gmail.com> | 2023-04-11 07:40:20 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-11 06:40:20 +0200 |
commit | 420b0c14eb0b82e05873191b277e889f95bc802b (patch) | |
tree | b7b44efd06deeefc61c1825aa7712831e7027e74 /tests/stdlib | |
parent | 4c073cffbe39ad85eb2efa2521c2ad3a97ba8268 (diff) | |
download | Nim-420b0c14eb0b82e05873191b277e889f95bc802b.tar.gz |
Fix option lists with additional indentation in Markdown (#21633)
This is more Markdown-ish way to fix issue #21055, then PR #21625. It does not enable RST definition lists, instead it makes adding additional indentation (less than 4) right after a paragraph be ignored, as it's done for all block elements in Markdown. (In this case this tenet is applied to option lists that are not part of CommonMark spec by themselves).
Diffstat (limited to 'tests/stdlib')
-rw-r--r-- | tests/stdlib/trst.nim | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/stdlib/trst.nim b/tests/stdlib/trst.nim index da787d274..c32ed1762 100644 --- a/tests/stdlib/trst.nim +++ b/tests/stdlib/trst.nim @@ -689,6 +689,32 @@ suite "RST parsing": rnLeaf 'desc2' """) + test "definition lists work correctly with additional indentation in Markdown": + check(dedent""" + Paragraph: + -c desc1 + -b desc2 + """.toAst() == + dedent""" + rnInner + rnInner + rnLeaf 'Paragraph' + rnLeaf ':' + rnOptionList + rnOptionListItem order=1 + rnOptionGroup + rnLeaf '-' + rnLeaf 'c' + rnDescription + rnLeaf 'desc1' + rnOptionListItem order=2 + rnOptionGroup + rnLeaf '-' + rnLeaf 'b' + rnDescription + rnLeaf 'desc2' + """) + test "RST comment": check(dedent""" .. comment1 |