From bd69218451037df2215ba0cbbb95eda2c3000450 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Mart=C3=ADn=20Barbero?= Date: Fri, 19 Jul 2019 18:32:43 +0200 Subject: [PATCH] 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. --- src/Text/Pandoc/Writers/Docx.hs | 6 +++--- test/docx/golden/lists.docx | Bin 10281 -> 10282 bytes test/docx/golden/lists_continuing.docx | Bin 10078 -> 10077 bytes test/docx/golden/lists_restarting.docx | Bin 10077 -> 10077 bytes 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 index 4a8764a6c35645590f1032d2ec299c0ea36e0ada..96a2816b785fcef85df12f6b8c6004bd9f5f65b1 100644 GIT binary patch delta 1279 zcmZ1(uquEzz?+#xgn@~JgTW>E(?;I;jLblK^Lj=BMou8ZZ^gCa_n%BY!K7K=Vt;#` zmdK{*Ialw6dHrT!YkQ#gEh3ru?)LSH8*Yc3)!L+FD$Y}}FTX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S-}bud8BZcJmdJ|f|IKJWEX?ctEEOH>OS zbU*0uOO;*N;CT7@XXk5^=kzc8q5QbxYq{vMi^nJD9}PLH)fcYZx$1V+uG%eKFSUc|4bnL$UqWg8?p4IyGc5%7hHLf4}zWyj-OR?o% za-{89@saSyCuYlTZaOlrWo_QVz)v5J$;IvXocL}%+vdJuhd(XmGQclt2brj zWj&m+K`w4@>4U&}M~|fWoIX1&Zz@>1WeP}Nut~X?xM;_=xZ<9r`70kMosM3RI`4iU z?+I0RKmG$(d|irMybKlZZhz0#AR=OQA;I8+lJ<+6-49B4+%nLppA+@)-oenxATQPb7{@x zt-shmvPcNW|7&|DjuJbY*NXN-BEepK2RO)oiF>kv8E$eXAYm`4U<{6y$?nQ$K{AuY zRqViYgo+tbmY%L+1{S@bBF%Vw@*5RxFi%QVnvr9&nW~OFDE4M+O`_v&e SJ_MR-Ir*=;IvcwRNFD&SR2K&T diff --git a/test/docx/golden/lists_continuing.docx b/test/docx/golden/lists_continuing.docx index 293bc34cca793aea5203d0513f4f2f8685581e05..e6bac969e3505377fa8969630d93166ebd56e351 100644 GIT binary patch delta 1390 zcmccTch`?Mz?+#xgn@~JgTW>E(?;I;jLblK^Lj=BMou8ZPrdQ>?D)win6&Dbv>Q52 zKBUolkL$MFf#NyG5~AJ8CYAc{ui2TrpuW5Pr! zU#o>-QAI55OXCYKy!4pq6JT;*Q);bK%|^Kh4_z@1N$Qg#G3~7CUg@PoBiO z92^NYY{!|v3^qa##okHx49H98AOX1_6JVRK%{%qc11%a0LwOrl1c`brw zDIK@ma%$yNt*fD{?+N4xiF{UGQ2ObcYT2VJL3w*Oo_TXzCtxk#uCsLq*i+96U2Iyw z)3YIH=3Ak?=C5lS!@kC<$_QUOym~udO^CpzE9p$ad7Wj3R&9j>))#C>o)oD;Qyc4__oXQi&HF66h|sdN72qJ=F} zi`~THmnWKRdk`k_caB&dtUc7Ov`Pu!CY%&3w*0SRGO zd1Gdf$mD9JvtZg=*$zziD4QYWjMK_y@}PK_qJL{9J0k@>JYb=jD$g}D^zzz&cKVZQ52 zKBUolkL$MFf#NyG5~AJ8CYAcztM?kS{pLvB5WB|Z+JE(v6F1-7moaq<(_EIxldl@7 zb{fcdW%^lGR^8EmcVgR)n0~#JN3ja{l4p7b*zdjYMO(q z=k9I#`0?_4z1d4Rn!oTo-MPIiqVI2B^heGZI~9=o_xGaBuvoFxPUcA1{_H z5>AUqY~wsTCpG5Dkwpbe(T-iV4)QPCe*}JIPrYOOM?Q7WzlgTl59z8&^Y*$t@8`M6 zIdg6DCCQb1$GDFi`zD@SS^NI={nxT@mZw@A{441GDAnub@A~x>%qW4sIe^6u9Quxcbo7GMdG`Z(>rbe<`|%&R;_Fi6;$^6Kcl&#`1`!df3ke1nl(b*m?0!(X z_MCHP_X4%#``;tud9TgbzhJ)p`TWBxRvIzx6m*ys#nr}Tosm@) zcWmm10~dc4R%<=V%}cx=t?wM7x9YLWV(}EA$r}v6d;VM@H$Tk#(v-@N6P|_YL`_*; zb1W}?&8%A4zMU`ZnM-RfZ~evokwro{{$JZOanzuGAkq&B>LRfn;DFT?_hbVzDrHYV zLfA##m>DE8xk~9QnD$b(1Jm8gW=L7%l(LyTC?2Nh--1HTW@=@fynt1Ha;FLpSlgK^2a9GgF)+NAV_*qp0}_6fMs$O3^Pasmw_&)~m?P3GikF8VAqOehkZ9Ur7Po<-?3_fzf0`RYkBP zxQ%T1ZUYT20_qe*v7lyhp{fE{4Je(-1I_WkP}4Sf15^!Til18wP|X#f8UYk@u1tQf zDi00=K{aWnG_lEzVxrpUPPLuNwMCMRf#H`d1A{1vcE!ngYARr7RNwKinhmsKA1AtZ zawl(8gLp@8@4N C_Rz@y diff --git a/test/docx/golden/lists_restarting.docx b/test/docx/golden/lists_restarting.docx index 2fcd77629a700c272eb2400f391ff678019c9186..3f153ce1d687aa96a89b4f023eb7a3b039255072 100644 GIT binary patch delta 957 zcmccXch`?Mz?+#xgn@~JgTW>E(?;I;jLblK^Lj=BMh+muZ?SNZ!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/test/docx/golden/table_with_list_cell.docx b/test/docx/golden/table_with_list_cell.docx index f4c01527aed93f6f6ac33484161f1fabb5beee85..9130c33f39d5fd6af1d0a22b45c6238d2d5ca5ed 100644 GIT binary patch delta 1222 zcmccWf61RWz?+#xgn@~JgQ3CU^G4qJjLblK^Lj=BMou8ZZ%csi)DM$SFlp8=uXfP5 zRkD@8ae_e9L8WsmjWc=cTpoLF`up8tmj;L-+fA;&&S!J(v`SZ4(s&Y_Y zt9dhN-e#Vj4O>lKPpYk~vaUXyH*Nj8_C?zkT~5&W%<#BtVT$ykZ4d5r^1e8AHkbR@ zZ>jEGO7%xf<#n##Vbf)GXQ}xX^#Yk~{}e55UgE!W>e}tXrBl03D<3?1kXXQZdCBeg zq>ez9L&kI8)lB<$morl^a_*6SPxr5XrXTnhc5 znSGrp;THmuIu9%;%t?A^leR{tiTO>V?t90TITN;=rB4= z{J-X0iB-;$SD`|a*)Ce&zkYJZiO+XA-Uj@icYynrzVpMkN40jpp2Bo$N{Ktq?~_gI z_4eIN52<*THb3y@aliEp3+LUk{r`IQx$^r;>`iipaU%PIYyLmq{D%=GIrvS{zcrJc zk%3_g3&Z9QEJon8FQm*#llevD z>*MneDTo}s|6Nn+UbMq>U(dDt(KWXwsTSYdWX^QmOQ)VG=W4!vPVUts+xHe)KL2MS zt}(s(Zp!`#&70C1GaLih+#*)`>~)ZT9ct%%`qes-KF-$<&qlM`X>mlpGH&GD?r>W| z_OL~VZiZaf69dmX5$h{`magCUIO%xy0bwV(4Q=%&RQqM*8+S@~zG#_}8!eG5QQAeAbXJ2!ax%+#8Tk`E~uGVkYXxbl*U$6iE?uwm8 zibcu{p-V+{R^4z2ee~IAZ40~H+V|U!E8Ts@$G7&Yk;>CmR=!uN9n&;9Ul;SAdj92Q zXT}>X$>jd&{OLr@}^FH zrltbs@v2KRJ(Qg!Co4K~;?l&%6bVxpE@NUlY;7M^$e`c@BT3GM7B=Go!8QVmA>|Gc;S$4ZHEuX|N-SpRy zSoJmDIm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