git.iko.soy/typeable/pandoc
on master help sign in
Docx writer: Fixed styles in footnotes.

Previously a footnote in a list item would be a list item, etc.!

commite3fd1cd108b5cd485c920bf0d1ec1f4ef9a38467 authorJohn MacFarlane <fiddlosopher@gmail.com> dateFri 20 Jan 2012, 13:32 (15 years ago) parentfbbff22
1 file changed+6
src/Text/Pandoc/Writers/Docx.hs+6
src/Text/Pandoc/Writers/Docx.hs+6
@@ -567,8 +567,14 @@ inlineToOpenXML opts (Note bs) = do
567567 let insertNoteRef (Plain ils : xs) = Plain (notemarkerXml : ils) : xs
568568 insertNoteRef (Para ils : xs) = Para (notemarkerXml : ils) : xs
569569 insertNoteRef xs = Para [notemarkerXml] : xs
570+ oldListLevel <- gets stListLevel
571+ oldParaProperties <- gets stParaProperties
572+ oldTextProperties <- gets stTextProperties
573+ modify $ \st -> st{ stListLevel = -1, stParaProperties = [], stTextProperties = [] }
570574 contents <- withParaProp (pStyle "FootnoteText") $ blocksToOpenXML opts
571575 $ insertNoteRef bs
576+ modify $ \st -> st{ stListLevel = oldListLevel, stParaProperties = oldParaProperties,
577+ stTextProperties = oldTextProperties }
572578 let newnote = mknode "w:footnote" [("w:id",show notenum)] $ contents
573579 modify $ \s -> s{ stFootnotes = newnote : notes }
574580 return [ mknode "w:r" []