aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
diff options
context:
space:
mode:
authorAlexander Krotov <ilabdsf@gmail.com>2018-10-04 12:05:20 +0300
committerAlexander Krotov <ilabdsf@gmail.com>2018-10-04 12:16:31 +0300
commit1a6e6a3a032b70eddc945eafd67599cc071b0f6a (patch)
tree1c280edfe9fad5d561a83dcc5a7fcb07017f3698 /src/Text/Pandoc/Readers
parent58ae017075cc9dbaacce85866b6fc04a02fa1ab4 (diff)
downloadpandoc-1a6e6a3a032b70eddc945eafd67599cc071b0f6a.tar.gz
Vimwiki reader: code cleanup
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r--src/Text/Pandoc/Readers/Vimwiki.hs18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/Text/Pandoc/Readers/Vimwiki.hs b/src/Text/Pandoc/Readers/Vimwiki.hs
index 824a912c3..15f0d991f 100644
--- a/src/Text/Pandoc/Readers/Vimwiki.hs
+++ b/src/Text/Pandoc/Readers/Vimwiki.hs
@@ -429,9 +429,7 @@ tableRow = try $ do
s <- lookAhead $ manyTill anyChar (try (char '|' >> many spaceChar
>> newline))
guard $ not $ "||" `isInfixOf` ("|" ++ s ++ "|")
- tr <- many tableCell
- many spaceChar >> char '\n'
- return tr
+ many tableCell <* many spaceChar <* char '\n'
tableCell :: PandocMonad m => VwParser m Blocks
tableCell = try $
@@ -451,13 +449,13 @@ ph s = try $ do
noHtmlPh :: PandocMonad m => VwParser m ()
noHtmlPh = try $
- () <$ (many spaceChar >> string "%nohtml" >> many spaceChar
- >> lookAhead newline)
+ () <$ many spaceChar <* string "%nohtml" <* many spaceChar
+ <* lookAhead newline
templatePh :: PandocMonad m => VwParser m ()
templatePh = try $
- () <$ (many spaceChar >> string "%template" >>many (noneOf "\n")
- >> lookAhead newline)
+ () <$ many spaceChar <* string "%template" <* many (noneOf "\n")
+ <* lookAhead newline
-- inline parser
@@ -617,10 +615,8 @@ procImgurl :: String -> String
procImgurl s = if take 6 s == "local:" then "file" ++ drop 5 s else s
inlineMath :: PandocMonad m => VwParser m Inlines
-inlineMath = try $ do
- char '$'
- contents <- many1Till (noneOf "\n") (char '$')
- return $ B.math contents
+inlineMath = try $
+ B.math <$ char '$' <*> many1Till (noneOf "\n") (char '$')
tag :: PandocMonad m => VwParser m Inlines
tag = try $ do