diff options
-rw-r--r-- | src/Text/Pandoc/Readers/Org/Blocks.hs | 4 | ||||
-rw-r--r-- | tests/Tests/Readers/Org.hs | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Readers/Org/Blocks.hs b/src/Text/Pandoc/Readers/Org/Blocks.hs index d14c894e6..8d22beb33 100644 --- a/src/Text/Pandoc/Readers/Org/Blocks.hs +++ b/src/Text/Pandoc/Readers/Org/Blocks.hs @@ -288,9 +288,7 @@ blockAttributes = try $ do let kvAttrs = foldl' (appendValues "ATTR_HTML") Nothing kv let name = lookup "NAME" kv let label = lookup "LABEL" kv - caption' <- maybe (return Nothing) - (fmap Just . parseFromString inlines) - caption + caption' <- sequence (parseFromString inlines . (++ "\n") <$> caption) kvAttrs' <- parseFromString keyValues . (++ "\n") $ fromMaybe mempty kvAttrs return $ BlockAttributes { blockAttrName = name diff --git a/tests/Tests/Readers/Org.hs b/tests/Tests/Readers/Org.hs index 49423bd11..3eab710dc 100644 --- a/tests/Tests/Readers/Org.hs +++ b/tests/Tests/Readers/Org.hs @@ -916,6 +916,12 @@ tests = ] =?> let attr = ("fig:myfig", mempty, mempty) in para (imageWith attr "blub.png" "fig:" "My figure") + + , "Figure with empty caption" =: + unlines [ "#+CAPTION:" + , "[[file:guess.jpg]]" + ] =?> + para (image "guess.jpg" "fig:" "") ] , "Footnote" =: |