-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
DOCX reader: do not issue warning for comments with ext. +styles
#10572
New issue
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
Conversation
This fixes jgm#10571 by also allowing `Div` as a block element
A different approach could be to "flatten" the style divs before checking that the content is safe. I'd assume that there are still cases where we'd want to show this warning even for Div elements. |
Like this? let paraOrPlain :: Block -> Bool
paraOrPlain (Para _) = True
paraOrPlain (Plain _) = True
paraOrPlain (Div _ nested) = (all paraOrPlain nested)
paraOrPlain _ = False |
src/Text/Pandoc/Readers/Docx.hs
Outdated
paraOrPlain _ = False | ||
paraOrPlain (Para _) = True | ||
paraOrPlain (Plain _) = True | ||
paraOrPlain (Div _ nested) = (all paraOrPlain nested) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the right approach. But you don't need the ()
around all paraOrPlain nested
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adjusted the style accordingly
This fixes #10571 by also allowing
Div
as a block element