Skip to content
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

#8986 filter elements that only contain visuals like images from normal meta #9170

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
#8986 minor refactor
  • Loading branch information
StephanMeijer committed Nov 5, 2023
commit 8e56a59cacdba662eb2a20c0c2052ba0f96522b4
7 changes: 5 additions & 2 deletions src/Text/Pandoc/Readers/Docx.hs
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,14 @@ sepBodyParts = span seperator

isVisualBodyPart :: BodyPart -> Bool
isVisualBodyPart (Paragraph _ []) = False
isVisualBodyPart (Paragraph _ parts) = all isVisualParPart parts
isVisualBodyPart (Paragraph _ pps) = isVisualParParts pps
isVisualBodyPart _ = False

isVisualParParts :: [ParPart] -> Bool
isVisualParParts = all isVisualParPart

isVisualParPart :: ParPart -> Bool
isVisualParPart (Field _ pps) = all isVisualParPart pps
isVisualParPart (Field _ pps) = isVisualParParts pps
isVisualParPart (PlainRun run) = isVisualRun run
isVisualParPart Drawing{} = True
isVisualParPart Chart = True
Expand Down