diff options
author | Albert Krewinkel <albert@zeitkraut.de> | 2016-10-14 23:16:51 +0200 |
---|---|---|
committer | Albert Krewinkel <albert@zeitkraut.de> | 2016-10-14 23:16:51 +0200 |
commit | 462c140eb6751bd7978bf74ebf3f38db3b0bd126 (patch) | |
tree | 743c80730eb8e937c2a5dfa2d8e9e93218e3ecc5 /tests/Tests/Readers | |
parent | 49b0b67b11b62032b2ade498c3efd5a762193d86 (diff) | |
download | pandoc-462c140eb6751bd7978bf74ebf3f38db3b0bd126.tar.gz |
Org reader: allow figure with empty caption
A `#+CAPTION` attribute before an image is enough to turn an image into a
figure. This wasn't the case because the `parseFromString` function, which
processes the caption value, would fail on empty values. Adding a newline
character to the caption value fixes this.
Fixes: #3161
Diffstat (limited to 'tests/Tests/Readers')
-rw-r--r-- | tests/Tests/Readers/Org.hs | 6 |
1 files changed, 6 insertions, 0 deletions
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" =: |