aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Writers/Docx.hs10
-rw-r--r--test/docx/golden/block_quotes.docxbin10147 -> 10022 bytes
-rw-r--r--test/docx/golden/codeblock.docxbin10007 -> 9882 bytes
-rw-r--r--test/docx/golden/comments.docxbin10328 -> 10203 bytes
-rw-r--r--test/docx/golden/custom_style_no_reference.docxbin10092 -> 9967 bytes
-rw-r--r--test/docx/golden/definition_list.docxbin9986 -> 9861 bytes
-rw-r--r--test/docx/golden/document-properties-short-desc.docxbin9902 -> 9872 bytes
-rw-r--r--test/docx/golden/document-properties.docxbin10388 -> 10358 bytes
-rw-r--r--test/docx/golden/headers.docxbin10134 -> 10009 bytes
-rw-r--r--test/docx/golden/image.docxbin26810 -> 26685 bytes
-rw-r--r--test/docx/golden/inline_code.docxbin9929 -> 9804 bytes
-rw-r--r--test/docx/golden/inline_formatting.docxbin10115 -> 9990 bytes
-rw-r--r--test/docx/golden/inline_images.docxbin26865 -> 26740 bytes
-rw-r--r--test/docx/golden/link_in_notes.docxbin10150 -> 10025 bytes
-rw-r--r--test/docx/golden/links.docxbin10329 -> 10204 bytes
-rw-r--r--test/docx/golden/lists.docxbin10400 -> 10281 bytes
-rw-r--r--test/docx/golden/lists_continuing.docxbin10199 -> 10078 bytes
-rw-r--r--test/docx/golden/lists_restarting.docxbin10199 -> 10077 bytes
-rw-r--r--test/docx/golden/nested_anchors_in_header.docxbin10196 -> 10166 bytes
-rw-r--r--test/docx/golden/notes.docxbin10100 -> 9975 bytes
-rw-r--r--test/docx/golden/table_one_row.docxbin9950 -> 9825 bytes
-rw-r--r--test/docx/golden/table_with_list_cell.docxbin10317 -> 10197 bytes
-rw-r--r--test/docx/golden/tables.docxbin10332 -> 10207 bytes
-rw-r--r--test/docx/golden/track_changes_deletion.docxbin9973 -> 9848 bytes
-rw-r--r--test/docx/golden/track_changes_insertion.docxbin9956 -> 9831 bytes
-rw-r--r--test/docx/golden/track_changes_move.docxbin9990 -> 9865 bytes
-rw-r--r--test/docx/golden/unicode.docxbin9914 -> 9789 bytes
-rw-r--r--test/docx/golden/verbatim_subsuper.docxbin9962 -> 9837 bytes
28 files changed, 9 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs
index 9e6c835c6..b9a3d4d7c 100644
--- a/src/Text/Pandoc/Writers/Docx.hs
+++ b/src/Text/Pandoc/Writers/Docx.hs
@@ -465,7 +465,15 @@ 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 pandocAdded e =
+ case findAttrBy ((== "abstractNumId") . qName) e >>= safeRead of
+ Just numid -> numid >= (990 :: Int)
+ Nothing ->
+ case findAttrBy ((== "numId") . qName) e >>= safeRead of
+ Just numid -> numid >= (1000 :: Int)
+ Nothing -> False
+ let oldElts = filter (not . pandocAdded) $ onlyElems (elContent numbering)
+ let allElts = oldElts ++ newNumElts
let numEntry = toEntry numpath epochtime $ renderXml numbering{ elContent =
-- we want all the abstractNums first, then the nums,
-- otherwise things break:
diff --git a/test/docx/golden/block_quotes.docx b/test/docx/golden/block_quotes.docx
index d118a6fb0..d90c7c740 100644
--- a/test/docx/golden/block_quotes.docx
+++ b/test/docx/golden/block_quotes.docx
Binary files differ
diff --git a/test/docx/golden/codeblock.docx b/test/docx/golden/codeblock.docx
index 7068893c1..d549ed20d 100644
--- a/test/docx/golden/codeblock.docx
+++ b/test/docx/golden/codeblock.docx
Binary files differ
diff --git a/test/docx/golden/comments.docx b/test/docx/golden/comments.docx
index 2cdf4c210..394ae9986 100644
--- a/test/docx/golden/comments.docx
+++ b/test/docx/golden/comments.docx
Binary files differ
diff --git a/test/docx/golden/custom_style_no_reference.docx b/test/docx/golden/custom_style_no_reference.docx
index f7e332963..f9c657289 100644
--- a/test/docx/golden/custom_style_no_reference.docx
+++ b/test/docx/golden/custom_style_no_reference.docx
Binary files differ
diff --git a/test/docx/golden/definition_list.docx b/test/docx/golden/definition_list.docx
index b57686e7d..1fe2a1e00 100644
--- a/test/docx/golden/definition_list.docx
+++ b/test/docx/golden/definition_list.docx
Binary files differ
diff --git a/test/docx/golden/document-properties-short-desc.docx b/test/docx/golden/document-properties-short-desc.docx
index ae2813b90..4ac249316 100644
--- a/test/docx/golden/document-properties-short-desc.docx
+++ b/test/docx/golden/document-properties-short-desc.docx
Binary files differ
diff --git a/test/docx/golden/document-properties.docx b/test/docx/golden/document-properties.docx
index 5db470cd1..00c78bc0f 100644
--- a/test/docx/golden/document-properties.docx
+++ b/test/docx/golden/document-properties.docx
Binary files differ
diff --git a/test/docx/golden/headers.docx b/test/docx/golden/headers.docx
index a51443929..b8b3e0e16 100644
--- a/test/docx/golden/headers.docx
+++ b/test/docx/golden/headers.docx
Binary files differ
diff --git a/test/docx/golden/image.docx b/test/docx/golden/image.docx
index e1f043ca3..ea5d13a08 100644
--- a/test/docx/golden/image.docx
+++ b/test/docx/golden/image.docx
Binary files differ
diff --git a/test/docx/golden/inline_code.docx b/test/docx/golden/inline_code.docx
index 46a3a6172..962a4f058 100644
--- a/test/docx/golden/inline_code.docx
+++ b/test/docx/golden/inline_code.docx
Binary files differ
diff --git a/test/docx/golden/inline_formatting.docx b/test/docx/golden/inline_formatting.docx
index c214c7eda..a1928cbaa 100644
--- a/test/docx/golden/inline_formatting.docx
+++ b/test/docx/golden/inline_formatting.docx
Binary files differ
diff --git a/test/docx/golden/inline_images.docx b/test/docx/golden/inline_images.docx
index 6ae175e4f..ef3376ffd 100644
--- a/test/docx/golden/inline_images.docx
+++ b/test/docx/golden/inline_images.docx
Binary files differ
diff --git a/test/docx/golden/link_in_notes.docx b/test/docx/golden/link_in_notes.docx
index 7376966b3..967347ae9 100644
--- a/test/docx/golden/link_in_notes.docx
+++ b/test/docx/golden/link_in_notes.docx
Binary files differ
diff --git a/test/docx/golden/links.docx b/test/docx/golden/links.docx
index d5839c517..142ac19cb 100644
--- a/test/docx/golden/links.docx
+++ b/test/docx/golden/links.docx
Binary files differ
diff --git a/test/docx/golden/lists.docx b/test/docx/golden/lists.docx
index bcc5e706d..4a8764a6c 100644
--- a/test/docx/golden/lists.docx
+++ b/test/docx/golden/lists.docx
Binary files differ
diff --git a/test/docx/golden/lists_continuing.docx b/test/docx/golden/lists_continuing.docx
index bd35f2887..293bc34cc 100644
--- a/test/docx/golden/lists_continuing.docx
+++ b/test/docx/golden/lists_continuing.docx
Binary files differ
diff --git a/test/docx/golden/lists_restarting.docx b/test/docx/golden/lists_restarting.docx
index f693fca6f..2fcd77629 100644
--- a/test/docx/golden/lists_restarting.docx
+++ b/test/docx/golden/lists_restarting.docx
Binary files differ
diff --git a/test/docx/golden/nested_anchors_in_header.docx b/test/docx/golden/nested_anchors_in_header.docx
index 56f59584a..735b5a4a5 100644
--- a/test/docx/golden/nested_anchors_in_header.docx
+++ b/test/docx/golden/nested_anchors_in_header.docx
Binary files differ
diff --git a/test/docx/golden/notes.docx b/test/docx/golden/notes.docx
index 197ccff94..597d7cc83 100644
--- a/test/docx/golden/notes.docx
+++ b/test/docx/golden/notes.docx
Binary files differ
diff --git a/test/docx/golden/table_one_row.docx b/test/docx/golden/table_one_row.docx
index ace98df83..92b8c3963 100644
--- a/test/docx/golden/table_one_row.docx
+++ b/test/docx/golden/table_one_row.docx
Binary files differ
diff --git a/test/docx/golden/table_with_list_cell.docx b/test/docx/golden/table_with_list_cell.docx
index fef0b16f5..f4c01527a 100644
--- a/test/docx/golden/table_with_list_cell.docx
+++ b/test/docx/golden/table_with_list_cell.docx
Binary files differ
diff --git a/test/docx/golden/tables.docx b/test/docx/golden/tables.docx
index ec73cfeef..61449d981 100644
--- a/test/docx/golden/tables.docx
+++ b/test/docx/golden/tables.docx
Binary files differ
diff --git a/test/docx/golden/track_changes_deletion.docx b/test/docx/golden/track_changes_deletion.docx
index dab2c3170..b52d6948d 100644
--- a/test/docx/golden/track_changes_deletion.docx
+++ b/test/docx/golden/track_changes_deletion.docx
Binary files differ
diff --git a/test/docx/golden/track_changes_insertion.docx b/test/docx/golden/track_changes_insertion.docx
index 7b5af8ed5..8528a4ded 100644
--- a/test/docx/golden/track_changes_insertion.docx
+++ b/test/docx/golden/track_changes_insertion.docx
Binary files differ
diff --git a/test/docx/golden/track_changes_move.docx b/test/docx/golden/track_changes_move.docx
index 666cd85eb..7904f4e87 100644
--- a/test/docx/golden/track_changes_move.docx
+++ b/test/docx/golden/track_changes_move.docx
Binary files differ
diff --git a/test/docx/golden/unicode.docx b/test/docx/golden/unicode.docx
index ef9480059..cbca6d83f 100644
--- a/test/docx/golden/unicode.docx
+++ b/test/docx/golden/unicode.docx
Binary files differ
diff --git a/test/docx/golden/verbatim_subsuper.docx b/test/docx/golden/verbatim_subsuper.docx
index dc9453430..4fbfd9c21 100644
--- a/test/docx/golden/verbatim_subsuper.docx
+++ b/test/docx/golden/verbatim_subsuper.docx
Binary files differ