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:
Andrey Makarov 2022-09-09 17:45:54 +03:00 • committed by GitHub
commit f6ee066ee2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 256 additions and 240 deletions

View file

@ -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"""