diff options
| author | John MacFarlane <[email protected]> | 2024-02-28 10:04:31 -0800 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2024-02-28 10:04:31 -0800 |
| commit | 6f87c9e29ae27df88e12e49cd98b4b2581c5cbdd (patch) | |
| tree | 28e0eae96ea94d53b99027d42e4e7a20fc1d6558 | |
| parent | b4e4da62a339abc3c1cccaf0c7317e059ce2f3cf (diff) | |
Docx reader: detect caption by style name not id.
The styleId can change depending on the localization.
Partially resolves #9518.
| -rw-r--r-- | src/Text/Pandoc/Readers/Docx/Parse.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Docx/Parse.hs b/src/Text/Pandoc/Readers/Docx/Parse.hs index 57f6e4c1c..75ea68a4d 100644 --- a/src/Text/Pandoc/Readers/Docx/Parse.hs +++ b/src/Text/Pandoc/Readers/Docx/Parse.hs @@ -766,7 +766,8 @@ elemToBodyPart ns element <$> asks envParStyles <*> asks envNumbering - let hasCaptionStyle = elem "Caption" (pStyleId <$> pStyle parstyle) + let hasCaptionStyle = + any ((== "caption") . pStyleName) (pStyle parstyle) let isTableNumberElt el@(Element name attribs _ _) = (qName name == "fldSimple" && |
