If --no-highlight is set, remove *Tok styles.
This commit is contained in:
parent
80715ecd7a
commit
8b3acde9de
1 changed files with 10 additions and 2 deletions
|
@ -395,8 +395,16 @@ writeDocx opts doc@(Pandoc meta _) = do
|
|||
|
||||
-- styles
|
||||
let newstyles = styleToOpenXml charStyles $ writerHighlightStyle opts
|
||||
let styledoc' = styledoc{ elContent = elContent styledoc ++
|
||||
[Elem x | x <- newstyles, writerHighlight opts] }
|
||||
let styledoc' = styledoc{ elContent = modifyContent (elContent styledoc) }
|
||||
where
|
||||
modifyContent
|
||||
| writerHighlight opts = (++ map Elem newstyles)
|
||||
| otherwise = filter notTokStyle
|
||||
notTokStyle (Elem el) = notStyle el || notTokId el
|
||||
notTokStyle _ = True
|
||||
notStyle = (/= myName "style") . elName
|
||||
notTokId = maybe True (`notElem` tokStys) . getAttrStyleId
|
||||
tokStys = map show $ enumFromTo KeywordTok NormalTok
|
||||
let styleEntry = toEntry stylepath epochtime $ renderXml styledoc'
|
||||
|
||||
-- construct word/numbering.xml
|
||||
|
|
Loading…
Reference in a new issue