Don't require blank line before Markdown code (#20215)
Fixes bug reported in https://github.com/nim-lang/Nim/pull/20189 affecting nimforum.
This commit is contained in:
parent
c579243e0c
commit
9f408ea943
4 changed files with 53 additions and 9 deletions
|
|
@ -576,6 +576,45 @@ suite "RST parsing":
|
|||
# | |
|
||||
# | \ indentation of exactly two spaces before 'let a = 1'
|
||||
|
||||
test "no blank line is required before or after Markdown code block":
|
||||
let inputBacktick = dedent"""
|
||||
Some text
|
||||
```
|
||||
CodeBlock()
|
||||
```
|
||||
Other text"""
|
||||
let inputTilde = dedent"""
|
||||
Some text
|
||||
~~~~~~~~~
|
||||
CodeBlock()
|
||||
~~~~~~~~~
|
||||
Other text"""
|
||||
let expected = dedent"""
|
||||
rnInner
|
||||
rnParagraph
|
||||
rnLeaf 'Some'
|
||||
rnLeaf ' '
|
||||
rnLeaf 'text'
|
||||
rnParagraph
|
||||
rnCodeBlock
|
||||
[nil]
|
||||
rnFieldList
|
||||
rnField
|
||||
rnFieldName
|
||||
rnLeaf 'default-language'
|
||||
rnFieldBody
|
||||
rnLeaf 'Nim'
|
||||
rnLiteralBlock
|
||||
rnLeaf '
|
||||
CodeBlock()'
|
||||
rnLeaf ' '
|
||||
rnLeaf 'Other'
|
||||
rnLeaf ' '
|
||||
rnLeaf 'text'
|
||||
"""
|
||||
check inputBacktick.toAst == expected
|
||||
check inputTilde.toAst == expected
|
||||
|
||||
test "option list has priority over definition list":
|
||||
check(dedent"""
|
||||
--defusages
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue