diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2013-01-25 16:13:58 -0800 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2013-01-25 16:13:58 -0800 |
commit | f7ecbd03d4cd9d8e9be3e1865e58556d55423ded (patch) | |
tree | c00b2f107256d27a5aedc6a16e9d63d025e21ce3 /src | |
parent | 4c74b7aaabe42428b8de9dade89e42c5cccc9463 (diff) | |
download | pandoc-f7ecbd03d4cd9d8e9be3e1865e58556d55423ded.tar.gz |
Markdown reader: More efficient version of scanForPipe.
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Readers/Markdown.hs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 0708690d4..69753c52a 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -1186,7 +1186,11 @@ pipeTableHeaderPart = do -- Succeed only if current line contains a pipe. scanForPipe :: Parser [Char] st () -scanForPipe = lookAhead (manyTill (satisfy (/='\n')) (char '|')) >> return () +scanForPipe = do + inp <- getInput + case break (\c -> c == '\n' || c == '|') inp of + (_,'|':_) -> return () + _ -> mzero -- | Parse a table using 'headerParser', 'rowParser', -- 'lineParser', and 'footerParser'. Variant of the version in |