diff options
| author | John MacFarlane <[email protected]> | 2017-08-20 10:42:52 -0700 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2017-08-20 10:42:52 -0700 |
| commit | dd08891e8ca10395de4fcb4040bd3c0d8892d5fe (patch) | |
| tree | 4cd1a267c663608c6deb97da3a497e9f4f365251 /src/Text/Pandoc/Writers/Texinfo.hs | |
| parent | bb2a4f2bc0ef7dcf2e9110762f8994a5c3834574 (diff) | |
Checkpoint, writers.figures
Diffstat (limited to 'src/Text/Pandoc/Writers/Texinfo.hs')
| -rw-r--r-- | src/Text/Pandoc/Writers/Texinfo.hs | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/Text/Pandoc/Writers/Texinfo.hs b/src/Text/Pandoc/Writers/Texinfo.hs index 549d4f3d9..2d38ffa4e 100644 --- a/src/Text/Pandoc/Writers/Texinfo.hs +++ b/src/Text/Pandoc/Writers/Texinfo.hs @@ -145,18 +145,17 @@ blockToTexinfo (Div _ bs) = blockListToTexinfo bs blockToTexinfo (Plain lst) = inlineListToTexinfo lst --- title beginning with fig: indicates that the image is a figure -blockToTexinfo (Para [Image attr txt (src,'f':'i':'g':':':tit)]) = do - capt <- if null txt - then return empty - else (\c -> text "@caption" <> braces c) `fmap` - inlineListToTexinfo txt - img <- inlineToTexinfo (Image attr txt (src,tit)) - return $ text "@float" $$ img $$ capt $$ text "@end float" - blockToTexinfo (Para lst) = inlineListToTexinfo lst -- this is handled differently from Plain in blockListToTexinfo +blockToTexinfo (Figure _attr (Caption _short long) bs) = do + contents <- blockListToTexinfo bs + capt <- blockListToTexinfo long + return $ text "@float" $$ + contents $$ + (text "@cation" <> braces capt) $$ + text "@end float" + blockToTexinfo (LineBlock lns) = blockToTexinfo $ linesToPara lns |
