git.iko.soy/typeable/pandoc
on master help sign in
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.

commitbd69218451037df2215ba0cbbb95eda2c3000450 authorAgustín Martín Barbero <agusmbaterra@gmail.com> dateFri 19 Jul 2019, 18:32 (7 years ago) parent72ddbf5
5 files changed+3−3
src/Text/Pandoc/Writers/Docx.hs+3−3 test/docx/golden/lists.docx test/docx/golden/lists_continuing.docx test/docx/golden/lists_restarting.docx test/docx/golden/table_with_list_cell.docx
src/Text/Pandoc/Writers/Docx.hs+3−3
@@ -1082,9 +1082,9 @@ getParaProps displayMathPara = do
10821082 listLevel <- asks envListLevel
10831083 numid <- asks envListNumId
10841084 let listPr = [mknode "w:numPr" []
1085− [ mknode "w:numId" [("w:val",show numid)] ()
1086− , mknode "w:ilvl" [("w:val",show listLevel)] () ] | listLevel >= 0 && not displayMathPara]
1087− return $ case props ++ listPr of
1085+ [ mknode "w:ilvl" [("w:val",show listLevel)] ()
1086+ , mknode "w:numId" [("w:val",show numid)] () ] | listLevel >= 0 && not displayMathPara]
1087+ return $ case listPr ++ props of
10881088 [] -> []
10891089 ps -> [mknode "w:pPr" [] ps]
10901090
test/docx/golden/lists.docx

Binary file not shown.

test/docx/golden/lists_continuing.docx

Binary file not shown.

test/docx/golden/lists_restarting.docx

Binary file not shown.

test/docx/golden/table_with_list_cell.docx

Binary file not shown.