@@ -409,8 +409,10 @@ codeBlockIndented = do
409409lhsCodeBlock :: GenParser Char ParserState Block
410410lhsCodeBlock = do
411411 failUnlessLHS
412− contents <- lhsCodeBlockBird <|> lhsCodeBlockLaTeX
413− return $ CodeBlock ("",["sourceCode","literate","haskell"],[]) contents
412+ liftM (CodeBlock ("",["sourceCode","literate","haskell"],[]))
413+ (lhsCodeBlockBird <|> lhsCodeBlockLaTeX)
414+ <|> liftM (CodeBlock ("",["sourceCode","haskell"],[]))
415+ lhsCodeBlockInverseBird
414416
415417lhsCodeBlockLaTeX :: GenParser Char ParserState String
416418lhsCodeBlockLaTeX = try $ do
@@ -421,10 +423,16 @@ lhsCodeBlockLaTeX = try $ do
421423 return $ stripTrailingNewlines contents
422424
423425lhsCodeBlockBird :: GenParser Char ParserState String
424−lhsCodeBlockBird = try $ do
426+lhsCodeBlockBird = lhsCodeBlockBirdWith '>'
427+
428+lhsCodeBlockInverseBird :: GenParser Char ParserState String
429+lhsCodeBlockInverseBird = lhsCodeBlockBirdWith '<'
430+
431+lhsCodeBlockBirdWith :: Char -> GenParser Char ParserState String
432+lhsCodeBlockBirdWith c = try $ do
425433 pos <- getPosition
426434 when (sourceColumn pos /= 1) $ fail "Not in first column"
427− lns <- many1 birdTrackLine
435+ lns <- many1 $ birdTrackLine c
428436 -- if (as is normal) there is always a space after >, drop it
429437 let lns' = if all (\ln -> null ln || take 1 ln == " ") lns
430438 then map (drop 1) lns
@@ -432,9 +440,9 @@ lhsCodeBlockBird = try $ do
432440 blanklines
433441 return $ intercalate "\n" lns'
434442
435−birdTrackLine :: GenParser Char st [Char]
436−birdTrackLine = do
437− char '>'
443+birdTrackLine :: Char -> GenParser Char st [Char]
444+birdTrackLine c = do
445+ char c
438446 manyTill anyChar newline
439447
440448