aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/Org/Inlines.hs
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2017-06-03 12:28:52 +0200
committerAlbert Krewinkel <albert@zeitkraut.de>2017-06-03 13:35:19 +0200
commit55d679e382954dd458acd6233609851748522d99 (patch)
tree4ed5996a1fed938b85c27e7b3671da6e52491c3e /src/Text/Pandoc/Readers/Org/Inlines.hs
parentd55f01c65f0a149b0951d4350293622385cceae9 (diff)
downloadpandoc-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.hs13
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'