diff options
author | Albert Krewinkel <albert@zeitkraut.de> | 2017-06-03 12:28:52 +0200 |
---|---|---|
committer | Albert Krewinkel <albert@zeitkraut.de> | 2017-06-03 13:35:19 +0200 |
commit | 55d679e382954dd458acd6233609851748522d99 (patch) | |
tree | 4ed5996a1fed938b85c27e7b3671da6e52491c3e /src/Text/Pandoc/Readers/Org/Inlines.hs | |
parent | d55f01c65f0a149b0951d4350293622385cceae9 (diff) | |
download | pandoc-55d679e382954dd458acd6233609851748522d99.tar.gz |
Improve code style in lua and org modules
Diffstat (limited to 'src/Text/Pandoc/Readers/Org/Inlines.hs')
-rw-r--r-- | src/Text/Pandoc/Readers/Org/Inlines.hs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/Text/Pandoc/Readers/Org/Inlines.hs b/src/Text/Pandoc/Readers/Org/Inlines.hs index af28701d7..66273e05d 100644 --- a/src/Text/Pandoc/Readers/Org/Inlines.hs +++ b/src/Text/Pandoc/Readers/Org/Inlines.hs @@ -343,11 +343,10 @@ orgRefCiteKey = let citeKeySpecialChars = "-_:\\./," :: String isCiteKeySpecialChar c = c `elem` citeKeySpecialChars isCiteKeyChar c = isAlphaNum c || isCiteKeySpecialChar c - - in try $ many1Till (satisfy isCiteKeyChar) - $ try . lookAhead $ do - many . satisfy $ isCiteKeySpecialChar - satisfy $ not . isCiteKeyChar + endOfCitation = try $ do + many $ satisfy isCiteKeySpecialChar + satisfy $ not . isCiteKeyChar + in try $ satisfy isCiteKeyChar `many1Till` lookAhead endOfCitation -- | Supported citation types. Only a small subset of org-ref types is @@ -415,7 +414,7 @@ referencedNote = try $ do return $ do notes <- asksF orgStateNotes' case lookup ref notes of - Nothing -> return $ B.str $ "[" ++ ref ++ "]" + Nothing -> return . B.str $ "[" ++ ref ++ "]" Just contents -> do st <- askF let contents' = runF contents st{ orgStateNotes' = [] } @@ -439,7 +438,7 @@ explicitOrImageLink = try $ do src <- srcF case cleanLinkString title of Just imgSrc | isImageFilename imgSrc -> - pure $ B.link src "" $ B.image imgSrc mempty mempty + pure . B.link src "" $ B.image imgSrc mempty mempty _ -> linkToInlinesF src =<< title' |