@@ -469,12 +469,12 @@ writeDocx opts doc = do
469 -- adds references to footnotes or endnotes we don't have...
469 -- adds references to footnotes or endnotes we don't have...
470 -- we do, however, copy some settings over from reference
470 -- we do, however, copy some settings over from reference
471 let settingsPath = "word/settings.xml"
471 let settingsPath = "word/settings.xml"
472− settingsList = [ "w:autoHyphenation"
472+ settingsList = [ "autoHyphenation"
473− , "w:consecutiveHyphenLimit"
473+ , "consecutiveHyphenLimit"
474− , "w:hyphenationZone"
474+ , "hyphenationZone"
475− , "w:doNotHyphenateCap"
475+ , "doNotHyphenateCap"
476− , "w:evenAndOddHeaders"
476+ , "evenAndOddHeaders"
477− , "w:proofState"
477+ , "proofState"
479 settingsEntry <- copyChildren refArchive distArchive settingsPath epochtime settingsList
479 settingsEntry <- copyChildren refArchive distArchive settingsPath epochtime settingsList
@@ -577,16 +577,17 @@ copyChildren :: (PandocMonad m)
577copyChildren refArchive distArchive path timestamp elNames = do
577copyChildren refArchive distArchive path timestamp elNames = do
578 ref <- parseXml refArchive distArchive path
578 ref <- parseXml refArchive distArchive path
579 dist <- parseXml distArchive distArchive path
579 dist <- parseXml distArchive distArchive path
581+ map cleanElem $ filterChildrenName (\e -> qName e `elem` elNames) ref
583+ [e | Elem e <- elContent dist, not (any (hasSameNameAs e) elsToCopy)]
580 return $ toEntry path timestamp $ renderXml dist{
584 return $ toEntry path timestamp $ renderXml dist{
581− elContent = elContent dist ++ copyContent ref
585+ elContent = map Elem elsToKeep ++ map Elem elsToCopy
584− strName QName{qName=name, qPrefix=prefix}
588+ hasSameNameAs (Element {elName = n1}) (Element {elName = n2}) =
585− | Just p <- prefix = p <> ":" <> name
589+ qName n1 == qName n2
587− shouldCopy = (`elem` elNames) . strName
588− cleanElem el@Element{elName=name} = Elem el{elName=name{qURI=Nothing}}
590+ cleanElem el@Element{elName=name} = el{elName=name{qURI=Nothing}}
589− copyContent = map cleanElem . filterChildrenName shouldCopy
591-- this is the lowest number used for a list numId
592-- this is the lowest number used for a list numId
592baseListId :: Int
593baseListId :: Int