From d63bba30661182f15e56d07997ee0f7b539eb2ce Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Tue, 20 Mar 2018 11:15:43 +0300 Subject: Muse writer: escape "]" brackets in URLs as "%5D" --- test/Tests/Writers/Muse.hs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test/Tests/Writers') diff --git a/test/Tests/Writers/Muse.hs b/test/Tests/Writers/Muse.hs index acd834173..2728fd9f9 100644 --- a/test/Tests/Writers/Muse.hs +++ b/test/Tests/Writers/Muse.hs @@ -372,6 +372,21 @@ tests = [ testGroup "block elements" =?> "[[URL:1.png][Link to image]]" , "link to image without description" =: link "1.png" "" (str "1.png") =?> "[[URL:1.png]]" + + , testGroup "escape brackets in links" + [ "link with description" + =: link "https://example.com/foo].txt" "" (str "Description") + =?> "[[https://example.com/foo%5D.txt][Description]]" + , "link without description" + =: link "https://example.com/foo].txt" "" (str "https://example.com/foo].txt") + =?> "[[https://example.com/foo%5D.txt][https://example.com/foo].txt]]" + , "image link with description" + =: link "foo]bar.png" "" (str "Image link") + =?> "[[URL:foo%5Dbar.png][Image link]]" + , "image link without description" + =: link "foo]bar.png" "" (str "foo]bar.png") + =?> "[[URL:foo%5Dbar.png][foo]bar.png]]" + ] ] , "image" =: image "image.png" "Image 1" (str "") =?> "[[image.png][Image 1]]" , "image with width" =: -- cgit v1.2.3