mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-23 00:36:29 +00:00
DOCX reader: do not issue warning for comments with +styles (#10572)
Closes #10571. Co-authored-by: Stephen Reindl <stephen.reindl@outlook.de>
This commit is contained in:
co-authored by
Stephen Reindl
parent
31e36d4fd5
commit
3c8ca600ef
@@ -357,9 +357,10 @@ extentToAttr _ = nullAttr
|
||||
blocksToInlinesWarn :: PandocMonad m => T.Text -> Blocks -> DocxContext m Inlines
|
||||
blocksToInlinesWarn cmtId blks = do
|
||||
let paraOrPlain :: Block -> Bool
|
||||
paraOrPlain (Para _) = True
|
||||
paraOrPlain (Plain _) = True
|
||||
paraOrPlain _ = False
|
||||
paraOrPlain (Para _) = True
|
||||
paraOrPlain (Plain _) = True
|
||||
paraOrPlain (Div _ nested) = all paraOrPlain nested
|
||||
paraOrPlain _ = False
|
||||
unless (all paraOrPlain blks) $
|
||||
lift $ P.report $ DocxParserWarning $
|
||||
"Docx comment " <> cmtId <> " will not retain formatting"
|
||||
|
||||
@@ -487,6 +487,11 @@ tests = [ testGroup "document"
|
||||
"comment warnings (all)"
|
||||
"docx/comments_warning.docx"
|
||||
["Docx comment 1 will not retain formatting"]
|
||||
, testForWarningsWithOpts def{readerTrackChanges=AllChanges,
|
||||
readerExtensions=extensionsFromList [Ext_styles]}
|
||||
"comments (with styles extension)"
|
||||
"docx/comments.docx"
|
||||
[]
|
||||
]
|
||||
, testGroup "media"
|
||||
[ testMediaBag
|
||||
|
||||
Reference in New Issue
Block a user