We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docx+styles
Explain the problem. When using the DOCX-reader with comments included, the extension +styles creates warnings with every comment:
+styles
~/src/mybook$ pandoc text/custom-reference.docx --from=docx+styles --to=native --track-changes=all --output=test.debug --verbose [WARNING] Docx parser warning: Docx comment 9 will not retain formatting ~/src/mybook$
Converting without the styles-extension, no warning is given:
$ pandoc text/custom-reference.docx --from=docx --to=native --track-changes=all --output=test.debug --verbose ~/src/mybook$
Pandoc version? 3.6.2
Looking at the source::
pandoc/src/Text/Pandoc/Readers/Docx.hs
Lines 358 to 366 in 220dde4
Para
Plain
If using +styles, all block elements are pretended with a Div element, even comment texts.
Div
Therefore the fix should be very straightforward:
blocksToInlinesWarn cmtId blks = do let paraOrPlain :: Block -> Bool paraOrPlain (Para _) = True paraOrPlain (Plain _) = True paraOrPlain (Div _ _) = True paraOrPlain _ = False unless (all paraOrPlain blks) $ lift $ P.report $ DocxParserWarning $ "Docx comment " <> cmtId <> " will not retain formatting" return $ blocksToInlines' (toList blks)
Example document custom-reference.docx
The text was updated successfully, but these errors were encountered:
DOCX reader: do not issue warning for comments with ext. +styles
daa4139
This fixes jgm#10571 by also allowing `Div` as a block element
DOCX reader: do not issue warning for comments with +styles (#10572)
3c8ca60
Closes #10571. Co-authored-by: Stephen Reindl <stephen.reindl@outlook.de>
Successfully merging a pull request may close this issue.
Explain the problem.
When using the DOCX-reader with comments included, the extension
+styles
creates warnings with every comment:Converting without the styles-extension, no warning is given:
Pandoc version?
3.6.2
Looking at the source::
pandoc/src/Text/Pandoc/Readers/Docx.hs
Lines 358 to 366 in 220dde4
only
Para
andPlain
are considered as save block elements.If using
+styles
, all block elements are pretended with aDiv
element, even comment texts.Therefore the fix should be very straightforward:
Example document
custom-reference.docx
The text was updated successfully, but these errors were encountered: