aboutsummaryrefslogtreecommitdiff
path: root/test/Haddock/ParserSpec.hs
diff options
context:
space:
mode:
authorNiklas Haas <git@nand.wakku.to>2014-02-22 21:15:34 +0100
committerNiklas Haas <git@nand.wakku.to>2014-02-22 21:31:03 +0100
commitfc7fd1875d31dbfd37eaa058177e534b4fc6bc25 (patch)
tree15cad6ae08c535594a452e67cbe2ddc785ba7676 /test/Haddock/ParserSpec.hs
parent91e2c21cfdaca7913dbfec17bdd7712c0c1ed732 (diff)
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.
Diffstat (limited to 'test/Haddock/ParserSpec.hs')
-rw-r--r--test/Haddock/ParserSpec.hs18
1 files changed, 18 insertions, 0 deletions
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/"