@@ -139,6 +139,11 @@ type DocxContext = ExceptT PandocError (ReaderT DEnv (State DState))
139139evalDocxContext :: DocxContext a -> DEnv -> DState -> Either PandocError a
140140evalDocxContext ctx env st = flip evalState st . flip runReaderT env . runExceptT $ ctx
141141
142+addDocxWarning :: String -> DocxContext ()
143+addDocxWarning msg = do
144+ warnings <- gets docxWarnings
145+ modify $ \s -> s {docxWarnings = msg : warnings}
146+
142147-- This is empty, but we put it in for future-proofing.
143148spansToKeep :: [String]
144149spansToKeep = []
@@ -321,6 +326,17 @@ extentToAttr (Just (w, h)) =
321326 showDim d = show (d / 914400) ++ "in"
322327extentToAttr _ = nullAttr
323328
329+blocksToInlinesWarn :: String -> Blocks -> DocxContext Inlines
330+blocksToInlinesWarn cmtId blks = do
331+ let blkList = toList blks
332+ notParaOrPlain :: Block -> Bool
333+ notParaOrPlain (Para _) = False
334+ notParaOrPlain (Plain _) = False
335+ notParaOrPlain _ = True
336+ when (not $ null $ filter notParaOrPlain blkList)
337+ (addDocxWarning $ "Docx comment " ++ cmtId ++ " will not retain formatting")
338+ return $ fromList $ blocksToInlines blkList
339+
324340parPartToInlines :: ParPart -> DocxContext Inlines
325341parPartToInlines (PlainRun r) = runToInlines r
326342parPartToInlines (Insertion _ author date runs) = do
@@ -346,8 +362,8 @@ parPartToInlines (CommentStart cmtId author date bodyParts) = do
346362 case readerTrackChanges opts of
347363 AllChanges -> do
348364 blks <- smushBlocks <$> mapM bodyPartToBlocks bodyParts
349− let ils = fromList $ blocksToInlines $ toList blks
350− attr = ("", ["comment-start"], [("id", cmtId), ("author", author), ("date", date)])
365+ ils <- blocksToInlinesWarn cmtId blks
366+ let attr = ("", ["comment-start"], [("id", cmtId), ("author", author), ("date", date)])
351367 return $ spanWith attr ils
352368 _ -> return mempty
353369parPartToInlines (CommentEnd cmtId) = do