From fc7fd1875d31dbfd37eaa058177e534b4fc6bc25 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Sat, 22 Feb 2014 21:15:34 +0100 Subject: Strip a single leading space from bird tracks (#201) This makes bird tracks in the form > foo > bar > bat parse as if they had been written as >foo >bar >bat ie. without the leading whitespace in front of every line. Ideally we also want to look into how leading whitespace affects code blocks written using the @ @ syntax, which are currently unaffected by this patch. --- test/Haddock/ParserSpec.hs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'test') diff --git a/test/Haddock/ParserSpec.hs b/test/Haddock/ParserSpec.hs index 455a67f1..ac57b644 100644 --- a/test/Haddock/ParserSpec.hs +++ b/test/Haddock/ParserSpec.hs @@ -360,6 +360,24 @@ spec = before initStaticOpts $ do ] `shouldParseTo` DocCodeBlock "foo\nbar\nbaz" + it "ignores single leading spaces" $ do + unlines [ + "> foo" + , "> bar" + , "> baz" + ] `shouldParseTo` DocCodeBlock "foo\nbar\nbaz" + + unlines [ + "> foo" + , ">" + , "> bar" + ] `shouldParseTo` DocCodeBlock "foo\n\nbar" + + unlines [ + ">foo" + , "> bar" + ] `shouldParseTo` DocCodeBlock "foo\n bar" + it "ignores nested markup" $ do unlines [ ">/foo/" -- cgit v1.2.3