Markdown links migration part 1 (#20319)
Markdown link migration part 1 Also the warning is improved a bit. Local links (targeting inside its document) which had had a full anchor were turned into concise form. The very fact that they existed may be due to the bug in reference to subsections fixed https://github.com/nim-lang/Nim/pull/20279, now they are working well (both in RST syntax and new Pandoc Markdown syntax implemented in https://github.com/nim-lang/Nim/pull/20304)
This commit is contained in:
parent
89e6540fd3
commit
f6ee066ee2
12 changed files with 256 additions and 240 deletions
|
|
@ -1181,6 +1181,22 @@ suite "Warnings":
|
|||
"input(9, 6) Warning: broken link 'short.link'"
|
||||
])
|
||||
|
||||
test "Pandoc Markdown concise link warning points to target":
|
||||
var warnings = new seq[string]
|
||||
check(
|
||||
"ref [here][target]".toAst(warnings=warnings) ==
|
||||
dedent"""
|
||||
rnInner
|
||||
rnLeaf 'ref'
|
||||
rnLeaf ' '
|
||||
rnPandocRef
|
||||
rnInner
|
||||
rnLeaf 'here'
|
||||
rnInner
|
||||
rnLeaf 'target'
|
||||
""")
|
||||
check warnings[] == @["input(1, 12) Warning: broken link 'target'"]
|
||||
|
||||
test "With include directive and blank lines at the beginning":
|
||||
"other.rst".writeFile(dedent"""
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue