git.iko.soy/typeable/pandoc
on master help sign in
Markdown+lhs reader: Require space after inverse bird tracks.
eebd778John MacFarlane
src/Tests/Readers/Markdown.hs+10
@@ -48,6 +48,16 @@ tests = [ testGroup "inline code"
48 "[^1]\n\n[^1]: my note\n \n in note\n"
48 "[^1]\n\n[^1]: my note\n \n in note\n"
49 =?> para (note (para "my note" +++ para "in note"))
49 =?> para (note (para "my note" +++ para "in note"))
50 ]
50 ]
51+ , testGroup "lhs"
52+ [ test (readMarkdown defaultParserState{stateLiterateHaskell = True})
53+ "inverse bird tracks and html" $
54+ "> a\n\n< b\n\n<div>\n"
55+ =?> codeBlockWith ("",["sourceCode","literate","haskell"],[]) "a"
56+ +++
57+ codeBlockWith ("",["sourceCode","haskell"],[]) "b"
58+ +++
59+ rawBlock "html" "<div>\n\n"
60+ ]
51-- the round-trip properties frequently fail
61-- the round-trip properties frequently fail
52-- , testGroup "round trip"
62-- , testGroup "round trip"
53-- [ property "p_markdown_round_trip" p_markdown_round_trip
63-- [ property "p_markdown_round_trip" p_markdown_round_trip
src/Text/Pandoc/Readers/Markdown.hs+3−1
@@ -471,8 +471,10 @@ lhsCodeBlockBirdWith c = try $ do
471 return $ intercalate "\n" lns'
471 return $ intercalate "\n" lns'
472
472
473birdTrackLine :: Char -> GenParser Char st [Char]
473birdTrackLine :: Char -> GenParser Char st [Char]
474−birdTrackLine c = do
474+birdTrackLine c = try $ do
475 char c
475 char c
476+ -- allow html tags on left margin:
477+ when (c == '<') $ notFollowedBy letter
476 manyTill anyChar newline
478 manyTill anyChar newline
477
479
478
480