summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEdwin Török <edwin@etorok.net>2023-12-17 23:10:28 +0000
committerJohn MacFarlane <jgm@berkeley.edu>2023-12-18 12:30:20 -0800
commitded8132d3039b18c52456a5cf0dd1044c42d867c (patch)
tree1e3012fbae31b8d7f1c4a14e2c108b0476736ea6 /src
parenteb387c699257a890f541c7c61da792c5bd4f0ee7 (diff)
fix(docx): fix validation error in w:nsid
The length here seems to refer to length in bytes (so twice as long in hex): ``` ./tmp/numbering-pretty.xml:4: element nsid: Schemas validity error : Element '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}nsid', attribute '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}val': [facet 'length'] The value 'A990' has a length of '2'; this differs from the allowed length of '4'. ``` [This](https://learn.microsoft.com/en-us/dotnet/api/documentformat.openxml.wordprocessing.nsid?view=openxml-2.8.1) also documents the longer values. Signed-off-by: Edwin Török <edwin@etorok.net>
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Writers/Docx.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs
index 765d95d6c..264926f29 100644
--- a/src/Text/Pandoc/Writers/Docx.hs
+++ b/src/Text/Pandoc/Writers/Docx.hs
@@ -753,7 +753,7 @@ mkNum marker numid =
mkAbstractNum :: ListMarker -> Element
mkAbstractNum marker =
mknode "w:abstractNum" [("w:abstractNumId",listMarkerToId marker)]
- $ mknode "w:nsid" [("w:val", "A" <> listMarkerToId marker)] ()
+ $ mknode "w:nsid" [("w:val", T.justifyRight 8 '0' ("A" <> listMarkerToId marker))] ()
: mknode "w:multiLevelType" [("w:val","multilevel")] ()
: map (mkLvl marker)
[0..maxListLevel]