mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-24 15:44:59 +08:00
Markdown reader: More efficient version of scanForPipe.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user