diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-07-14 13:16:20 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-07-14 13:16:40 -0700 |
commit | 9e0fb844a9f1d4b749854a775e4492f9e51e8fbf (patch) | |
tree | 74805f59aaaf89a7d744856c7818bfb8cf050dcf /tests | |
parent | 9cdfd4f6491cbf9e3002e88be8be9ebeb48ba2bb (diff) | |
download | pandoc-9e0fb844a9f1d4b749854a775e4492f9e51e8fbf.tar.gz |
Markdown reader: don't allow bare URI links or autolinks in link label.
Added test cases.
Closes #2300.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Tests/Readers/Markdown.hs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/Tests/Readers/Markdown.hs b/tests/Tests/Readers/Markdown.hs index a041620e7..17bfd332e 100644 --- a/tests/Tests/Readers/Markdown.hs +++ b/tests/Tests/Readers/Markdown.hs @@ -194,7 +194,7 @@ tests = [ testGroup "inline code" =?> para (link "/there.0" "" "hi") ] , testGroup "bare URIs" - (map testBareLink bareLinkTests) + (map testBareLink bareLinkTests) , testGroup "autolinks" [ "with unicode dash following" =: "<http://foo.bar>\8212" =?> para (autolink "http://foo.bar" <> @@ -203,6 +203,17 @@ tests = [ testGroup "inline code" "<www.boe.es/buscar/act.php?id=BOE-A-1996-8930#a66>" =?> para (text "<www.boe.es/buscar/act.php?id=BOE-A-1996-8930#a66>") ] + , testGroup "links" + [ "no autolink inside link" =: + "[<https://example.org>](url)" =?> + para (link "url" "" (text "<https://example.org>")) + , "no inline link inside link" =: + "[[a](url2)](url)" =?> + para (link "url" "" (text "[a](url2)")) + , "no bare URI inside link" =: + "[https://example.org(](url)" =?> + para (link "url" "" (text "https://example.org(")) + ] , testGroup "Headers" [ "blank line before header" =: "\n# Header\n" |