git.iko.soy/typeable/pandoc
on master help sign in
LaTeX writer: Properly escape pdftitle, pdfauthor.

Closes #1059.

commit892ba2dd163cbba598cbd86814a594008aae9f27 authorJohn MacFarlane <fiddlosopher@gmail.com> dateSat 16 Nov 2013, 14:09 (13 years ago) parentb4441c9
1 file changed+4−2
src/Text/Pandoc/Writers/LaTeX.hs+4−2
src/Text/Pandoc/Writers/LaTeX.hs+4−2
@@ -126,14 +126,16 @@ pandocToLaTeX options (Pandoc meta blocks) = do
126126 (biblioTitle :: String) <- liftM (render colwidth) $ inlineListToLaTeX lastHeader
127127 let main = render colwidth $ vsep body
128128 st <- get
129+ titleMeta <- stringToLaTeX TextString $ stringify $ docTitle meta
130+ authorsMeta <- mapM (stringToLaTeX TextString . stringify) $ docAuthors meta
129131 let context = defField "toc" (writerTableOfContents options) $
130132 defField "toc-depth" (show (writerTOCDepth options -
131133 if writerChapters options
132134 then 1
133135 else 0)) $
134136 defField "body" main $
135− defField "title-meta" (stringify $ docTitle meta) $
136− defField "author-meta" (intercalate "; " $ map stringify $ docAuthors meta) $
137+ defField "title-meta" titleMeta $
138+ defField "author-meta" (intercalate "; " authorsMeta) $
137139 defField "documentclass" (if writerBeamer options
138140 then ("beamer" :: String)
139141 else if writerChapters options