@@ -139,6 +139,11 @@ type DocxContext = ExceptT PandocError (ReaderT DEnv (State DState))
139evalDocxContext :: DocxContext a -> DEnv -> DState -> Either PandocError a
139evalDocxContext :: DocxContext a -> DEnv -> DState -> Either PandocError a
140evalDocxContext ctx env st = flip evalState st . flip runReaderT env . runExceptT $ ctx
140evalDocxContext ctx env st = flip evalState st . flip runReaderT env . runExceptT $ ctx
142+addDocxWarning :: String -> DocxContext ()
143+addDocxWarning msg = do
144+ warnings <- gets docxWarnings
145+ modify $ \s -> s {docxWarnings = msg : warnings}
142-- This is empty, but we put it in for future-proofing.
147-- This is empty, but we put it in for future-proofing.
143spansToKeep :: [String]
148spansToKeep :: [String]
144spansToKeep = []
149spansToKeep = []
@@ -321,6 +326,17 @@ extentToAttr (Just (w, h)) =
321 showDim d = show (d / 914400) ++ "in"
326 showDim d = show (d / 914400) ++ "in"
322extentToAttr _ = nullAttr
327extentToAttr _ = nullAttr
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
324parPartToInlines :: ParPart -> DocxContext Inlines
340parPartToInlines :: ParPart -> DocxContext Inlines
325parPartToInlines (PlainRun r) = runToInlines r
341parPartToInlines (PlainRun r) = runToInlines r
326parPartToInlines (Insertion _ author date runs) = do
342parPartToInlines (Insertion _ author date runs) = do
@@ -346,8 +362,8 @@ parPartToInlines (CommentStart cmtId author date bodyParts) = do
346 case readerTrackChanges opts of
362 case readerTrackChanges opts of
347 AllChanges -> do
363 AllChanges -> do
348 blks <- smushBlocks <$> mapM bodyPartToBlocks bodyParts
364 blks <- smushBlocks <$> mapM bodyPartToBlocks bodyParts
349− let ils = fromList $ blocksToInlines $ toList blks
365+ ils <- blocksToInlinesWarn cmtId blks
350− attr = ("", ["comment-start"], [("id", cmtId), ("author", author), ("date", date)])
366+ let attr = ("", ["comment-start"], [("id", cmtId), ("author", author), ("date", date)])
351 return $ spanWith attr ils
367 return $ spanWith attr ils
352 _ -> return mempty
368 _ -> return mempty
353parPartToInlines (CommentEnd cmtId) = do
369parPartToInlines (CommentEnd cmtId) = do