@@ -211,12 +211,21 @@ blockToRST :: PandocMonad m
211211 => Block -- ^ Block element
212212 -> RST m Doc
213213blockToRST Null = return empty
214+blockToRST (Div ("",["admonition-title"],[]) _) = return empty
215+ -- this is generated by the rst reader and can safely be
216+ -- omitted when we're generating rst
214217blockToRST (Div (ident,classes,_kvs) bs) = do
215218 contents <- blockListToRST bs
216− let classes' = filter (/= "container") classes
219+ let admonitions = ["attention","caution","danger","error","hint",
220+ "important","note","tip","warning","admonition"]
221+ let admonition = case classes of
222+ (cl:_)
223+ | cl `elem` admonitions
224+ -> ".. " <> text cl <> "::"
225+ cls -> ".. container::" <> space <>
226+ text (unwords (filter (/= "container") cls))
217227 return $ blankline $$
218− (".. container::" <> space <>
219− text (unwords classes')) $$
228+ admonition $$
220229 (if null ident
221230 then blankline
222231 else " :name: " <> text ident $$ blankline) $$