git.iko.soy/typeable/pandoc
on master help sign in
Org writer: remove blank line after figure caption

Org-mode only treats an image as a figure if it is directly preceded by a caption.

commit91afa513ad495bdc277c94ac2a4a4b829423f222 authorAlbert Krewinkel <albert@zeitkraut.de> dateThu 18 Aug 2016, 14:32 (10 years ago) parent3a44ee6
2 files changed+2−4
src/Text/Pandoc/Writers/Org.hs+2−3 tests/writer.org−1
src/Text/Pandoc/Writers/Org.hs+2−3
@@ -158,10 +158,9 @@ blockToOrg (Plain inlines) = inlineListToOrg inlines
158158blockToOrg (Para [Image attr txt (src,'f':'i':'g':':':tit)]) = do
159159 capt <- if null txt
160160 then return empty
161− else (\c -> "#+CAPTION: " <> c <> blankline) `fmap`
162− inlineListToOrg txt
161+ else ("#+CAPTION: " <>) `fmap` inlineListToOrg txt
163162 img <- inlineToOrg (Image attr txt (src,tit))
164− return $ capt <> img
163+ return $ capt $$ img
165164blockToOrg (Para inlines) = do
166165 contents <- inlineListToOrg inlines
167166 return $ contents <> blankline
tests/writer.org−1
@@ -808,7 +808,6 @@ Auto-links should not occur here: =<http://example.com/>=
808808From "Voyage dans la Lune" by Georges Melies (1902):
809809
810810#+CAPTION: lalune
811−
812811[[lalune.jpg]]
813812Here is a movie [[movie.jpg]] icon.
814813