From e3fd1cd108b5cd485c920bf0d1ec1f4ef9a38467 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 20 Jan 2012 13:32:56 -0800 Subject: Docx writer: Fixed styles in footnotes. Previously a footnote in a list item would be a list item, etc.! --- src/Text/Pandoc/Writers/Docx.hs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/Text/Pandoc/Writers/Docx.hs') 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" [] -- cgit v1.2.3