diff options
| author | John MacFarlane <jgm@berkeley.edu> | 2023-08-14 10:07:14 -0700 |
|---|---|---|
| committer | John MacFarlane <jgm@berkeley.edu> | 2023-08-14 10:07:14 -0700 |
| commit | 6067e477acd933316ba23a1838aafffad872f627 (patch) | |
| tree | ff3a3cb99c9052a9bd7803298a29b8e7b9b7898e /src | |
| parent | 948567f200ddaf59c87d0155bb0d652930601a61 (diff) | |
Docx reader: Avoid spurious block quotes in list items.
The docx reader was overzealous in detecting indented
paragraphs as block quotes, leading to list items sometimes
being put in block quotes (especially in docx created by
Google Docs).
Closes #8836.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Text/Pandoc/Readers/Docx.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Readers/Docx.hs b/src/Text/Pandoc/Readers/Docx.hs index c1dd3dff4..4ab40f5a6 100644 --- a/src/Text/Pandoc/Readers/Docx.hs +++ b/src/Text/Pandoc/Readers/Docx.hs @@ -624,10 +624,10 @@ extraAttr s = ("", [], [("custom-style", fromStyleName $ getStyleName s)]) paragraphStyleToTransform :: PandocMonad m => ParagraphStyle -> DocxContext m (Blocks -> Blocks) paragraphStyleToTransform pPr = - let stylenames = map getStyleName (pStyle pPr) - transform = if (`elem` listParagraphStyles) `any` stylenames || relativeIndent pPr <= 0 - then id - else blockQuote + let transform = if relativeIndent pPr > 0 && not (numbered pPr) && + not (any ((`elem` listParagraphStyles) . getStyleName) (pStyle pPr)) + then blockQuote + else id in do extStylesEnabled <- asks (isEnabled Ext_styles . docxOptions) return $ foldr (\parStyle transform' -> |
