git.iko.soy/typeable/pandoc
on master help sign in
ConTeXt writer: Don't hardcode figure/table placement.
bb0f299John MacFarlane
data/templates+1−1

Submodule changed.

src/Text/Pandoc/Writers/ConTeXt.hs+4−4
@@ -130,7 +130,7 @@ blockToConTeXt (Plain lst) = inlineListToConTeXt lst
130-- title beginning with fig: indicates that the image is a figure
130-- title beginning with fig: indicates that the image is a figure
131blockToConTeXt (Para [Image txt (src,'f':'i':'g':':':_)]) = do
131blockToConTeXt (Para [Image txt (src,'f':'i':'g':':':_)]) = do
132 capt <- inlineListToConTeXt txt
132 capt <- inlineListToConTeXt txt
133− return $ blankline $$ "\\placefigure[here]" <> braces capt <>
133+ return $ blankline $$ "\\placefigure" <> braces capt <>
134 braces ("\\externalfigure" <> brackets (text src)) <> blankline
134 braces ("\\externalfigure" <> brackets (text src)) <> blankline
135blockToConTeXt (Para lst) = do
135blockToConTeXt (Para lst) = do
136 contents <- inlineListToConTeXt lst
136 contents <- inlineListToConTeXt lst
@@ -205,9 +205,9 @@ blockToConTeXt (Table caption aligns widths heads rows) = do
205 else liftM ($$ "\\HL") $ tableRowToConTeXt heads
205 else liftM ($$ "\\HL") $ tableRowToConTeXt heads
206 captionText <- inlineListToConTeXt caption
206 captionText <- inlineListToConTeXt caption
207 rows' <- mapM tableRowToConTeXt rows
207 rows' <- mapM tableRowToConTeXt rows
208− return $ "\\placetable" <> brackets ("here" <> if null caption
208+ return $ "\\placetable" <> (if null caption
209− then ",none"
209+ then brackets "none"
210− else "")
210+ else empty)
211 <> braces captionText $$
211 <> braces captionText $$
212 "\\starttable" <> brackets (text colDescriptors) $$
212 "\\starttable" <> brackets (text colDescriptors) $$
213 "\\HL" $$ headers $$
213 "\\HL" $$ headers $$