diff options
author | Agustín Martín Barbero <agusmbaterra@gmail.com> | 2019-07-19 18:32:43 +0200 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2019-07-19 09:32:43 -0700 |
commit | bd69218451037df2215ba0cbbb95eda2c3000450 (patch) | |
tree | 6b2cc40ed5b15c32d7c7b492174198d9b6a0db21 | |
parent | 72ddbf5994a09ca45b57e1260f71a081e4d085a5 (diff) | |
download | pandoc-bd69218451037df2215ba0cbbb95eda2c3000450.tar.gz |
Change order of ilvl and numId in document.xml (#5647)
Workaround for Word Online shortcomming. Fixes #5645
Also, make list para properties go first.
This reordering of properties shouldn't be necessary but
it seems Word Online does not understand the docx correctly otherwise.
-rw-r--r-- | src/Text/Pandoc/Writers/Docx.hs | 6 | ||||
-rw-r--r-- | test/docx/golden/lists.docx | bin | 10281 -> 10282 bytes | |||
-rw-r--r-- | test/docx/golden/lists_continuing.docx | bin | 10078 -> 10077 bytes | |||
-rw-r--r-- | test/docx/golden/lists_restarting.docx | bin | 10077 -> 10077 bytes | |||
-rw-r--r-- | test/docx/golden/table_with_list_cell.docx | bin | 10197 -> 10194 bytes |
5 files changed, 3 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs index a7b9ee621..5fc004238 100644 --- a/src/Text/Pandoc/Writers/Docx.hs +++ b/src/Text/Pandoc/Writers/Docx.hs @@ -1082,9 +1082,9 @@ getParaProps displayMathPara = do listLevel <- asks envListLevel numid <- asks envListNumId let listPr = [mknode "w:numPr" [] - [ mknode "w:numId" [("w:val",show numid)] () - , mknode "w:ilvl" [("w:val",show listLevel)] () ] | listLevel >= 0 && not displayMathPara] - return $ case props ++ listPr of + [ mknode "w:ilvl" [("w:val",show listLevel)] () + , mknode "w:numId" [("w:val",show numid)] () ] | listLevel >= 0 && not displayMathPara] + return $ case listPr ++ props of [] -> [] ps -> [mknode "w:pPr" [] ps] diff --git a/test/docx/golden/lists.docx b/test/docx/golden/lists.docx Binary files differindex 4a8764a6c..96a2816b7 100644 --- a/test/docx/golden/lists.docx +++ b/test/docx/golden/lists.docx diff --git a/test/docx/golden/lists_continuing.docx b/test/docx/golden/lists_continuing.docx Binary files differindex 293bc34cc..e6bac969e 100644 --- a/test/docx/golden/lists_continuing.docx +++ b/test/docx/golden/lists_continuing.docx diff --git a/test/docx/golden/lists_restarting.docx b/test/docx/golden/lists_restarting.docx Binary files differindex 2fcd77629..3f153ce1d 100644 --- a/test/docx/golden/lists_restarting.docx +++ b/test/docx/golden/lists_restarting.docx diff --git a/test/docx/golden/table_with_list_cell.docx b/test/docx/golden/table_with_list_cell.docx Binary files differindex f4c01527a..9130c33f3 100644 --- a/test/docx/golden/table_with_list_cell.docx +++ b/test/docx/golden/table_with_list_cell.docx |