git.iko.soy/typeable/pandoc
on master help sign in
Changed style names in reference docx.

FootnoteReference -> FootnoteRef. Hyperlink -> Link. Why? Because the old names got changed by Word when the reference.docx was edited. I don't understand why, but this fixes things. Closes #414.

commit3fca434737f0eee706c02fba6a2a2629338a1065 authorJohn MacFarlane <fiddlosopher@gmail.com> dateTue 26 Feb 2013, 22:01 (14 years ago) parentcaed0df
2 files changed+4−4
data/reference.docx src/Text/Pandoc/Writers/Docx.hs+4−4
data/reference.docx

Binary file not shown.

src/Text/Pandoc/Writers/Docx.hs+4−4
@@ -655,7 +655,7 @@ inlineToOpenXML opts (Note bs) = do
655655 notes <- gets stFootnotes
656656 notenum <- getUniqueId
657657 let notemarker = mknode "w:r" []
658− [ mknode "w:rPr" [] (rStyle "FootnoteReference")
658+ [ mknode "w:rPr" [] (rStyle "FootnoteRef")
659659 , mknode "w:footnoteRef" [] () ]
660660 let notemarkerXml = RawInline "openxml" $ ppElement notemarker
661661 let insertNoteRef (Plain ils : xs) = Plain (notemarkerXml : ils) : xs
@@ -672,15 +672,15 @@ inlineToOpenXML opts (Note bs) = do
672672 let newnote = mknode "w:footnote" [("w:id", notenum)] $ contents
673673 modify $ \s -> s{ stFootnotes = newnote : notes }
674674 return [ mknode "w:r" []
675− [ mknode "w:rPr" [] (rStyle "FootnoteReference")
675+ [ mknode "w:rPr" [] (rStyle "FootnoteRef")
676676 , mknode "w:footnoteReference" [("w:id", notenum)] () ] ]
677677-- internal link:
678678inlineToOpenXML opts (Link txt ('#':xs,_)) = do
679− contents <- withTextProp (rStyle "Hyperlink") $ inlinesToOpenXML opts txt
679+ contents <- withTextProp (rStyle "Link") $ inlinesToOpenXML opts txt
680680 return [ mknode "w:hyperlink" [("w:anchor",xs)] contents ]
681681-- external link:
682682inlineToOpenXML opts (Link txt (src,_)) = do
683− contents <- withTextProp (rStyle "Hyperlink") $ inlinesToOpenXML opts txt
683+ contents <- withTextProp (rStyle "Link") $ inlinesToOpenXML opts txt
684684 extlinks <- gets stExternalLinks
685685 id' <- case M.lookup src extlinks of
686686 Just i -> return i