aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2012-01-20 13:32:56 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2012-01-20 13:32:56 -0800
commite3fd1cd108b5cd485c920bf0d1ec1f4ef9a38467 (patch)
tree3ef3178c0d172ae16ec9b8d2e6b6e64848d14edf
parentfbbff22f0650a310d3c73f181458990ff9bdfec1 (diff)
downloadpandoc-e3fd1cd108b5cd485c920bf0d1ec1f4ef9a38467.tar.gz
Docx writer: Fixed styles in footnotes.
Previously a footnote in a list item would be a list item, etc.!
-rw-r--r--src/Text/Pandoc/Writers/Docx.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs
index 839a9f7e5..f0cb5b477 100644
--- a/src/Text/Pandoc/Writers/Docx.hs
+++ b/src/Text/Pandoc/Writers/Docx.hs
@@ -567,8 +567,14 @@ inlineToOpenXML opts (Note bs) = do
let insertNoteRef (Plain ils : xs) = Plain (notemarkerXml : ils) : xs
insertNoteRef (Para ils : xs) = Para (notemarkerXml : ils) : xs
insertNoteRef xs = Para [notemarkerXml] : xs
+ oldListLevel <- gets stListLevel
+ oldParaProperties <- gets stParaProperties
+ oldTextProperties <- gets stTextProperties
+ modify $ \st -> st{ stListLevel = -1, stParaProperties = [], stTextProperties = [] }
contents <- withParaProp (pStyle "FootnoteText") $ blocksToOpenXML opts
$ insertNoteRef bs
+ modify $ \st -> st{ stListLevel = oldListLevel, stParaProperties = oldParaProperties,
+ stTextProperties = oldTextProperties }
let newnote = mknode "w:footnote" [("w:id",show notenum)] $ contents
modify $ \s -> s{ stFootnotes = newnote : notes }
return [ mknode "w:r" []