Skip to content

Commit

Permalink
Docx writer: Section numbering carries over from reference.docx.
Browse files Browse the repository at this point in the history
Closes #1305.
  • Loading branch information
John MacFarlane committed Jun 3, 2014
1 parent 0ddb4cd commit 45f3851
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Text/Pandoc/Writers/Docx.hs
Expand Up @@ -291,8 +291,13 @@ writeDocx opts doc@(Pandoc meta _) = do
let numpath = "word/numbering.xml"
numbering <- parseXml refArchive distArchive numpath
newNumElts <- mkNumbering (stLists st)
let allElts = onlyElems (elContent numbering) ++ newNumElts
let numEntry = toEntry numpath epochtime $ renderXml numbering{ elContent =
elContent numbering ++ map Elem newNumElts }
-- we want all the abstractNums first, then the nums,
-- otherwise things break:
[Elem e | e <- allElts
, qName (elName e) == "abstractNum" ] ++
[Elem e | e <- allElts, qName (elName e) == "num" ] }
let docPropsPath = "docProps/core.xml"
let docProps = mknode "cp:coreProperties"
[("xmlns:cp","http://schemas.openxmlformats.org/package/2006/metadata/core-properties")
Expand Down

0 comments on commit 45f3851

Please sign in to comment.