From 1a4b47e93368bfbd31daccdfedbd9527ee740201 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 14 Jan 2013 20:53:08 -0800 Subject: Implemented Ext_implicit_figures. * In markdown reader, add a '\1' character to the beginning of the title of an image that is alone in its paragraph, if implicit_figures extension is selected. * In writers, check for Para [Image alt (src,'\1':tit)] and treat it as a figure if possible. * Updated tests. This is a bit of a hack, but it allows us to make implicit_figures an extension of the markdown reader, rather than the writers. --- src/Text/Pandoc/Writers/AsciiDoc.hs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/Text/Pandoc/Writers/AsciiDoc.hs') diff --git a/src/Text/Pandoc/Writers/AsciiDoc.hs b/src/Text/Pandoc/Writers/AsciiDoc.hs index 30da6ac1a..93d18eff8 100644 --- a/src/Text/Pandoc/Writers/AsciiDoc.hs +++ b/src/Text/Pandoc/Writers/AsciiDoc.hs @@ -116,6 +116,8 @@ blockToAsciiDoc _ Null = return empty blockToAsciiDoc opts (Plain inlines) = do contents <- inlineListToAsciiDoc opts inlines return $ contents <> cr +blockToAsciiDoc opts (Para [Image alt (src,'\1':tit)]) = + blockToAsciiDoc opts (Para [Image alt (src,tit)]) blockToAsciiDoc opts (Para inlines) = do contents <- inlineListToAsciiDoc opts inlines -- escape if para starts with ordered list marker -- cgit v1.2.3