git.iko.soy/typeable/pandoc
on master help sign in
LaTeX writer: Properly escape pdftitle, pdfauthor.
892ba2dJohn MacFarlane
src/Text/Pandoc/Writers/LaTeX.hs+4−2
@@ -126,14 +126,16 @@ pandocToLaTeX options (Pandoc meta blocks) = do
126 (biblioTitle :: String) <- liftM (render colwidth) $ inlineListToLaTeX lastHeader
126 (biblioTitle :: String) <- liftM (render colwidth) $ inlineListToLaTeX lastHeader
127 let main = render colwidth $ vsep body
127 let main = render colwidth $ vsep body
128 st <- get
128 st <- get
129+ titleMeta <- stringToLaTeX TextString $ stringify $ docTitle meta
130+ authorsMeta <- mapM (stringToLaTeX TextString . stringify) $ docAuthors meta
129 let context = defField "toc" (writerTableOfContents options) $
131 let context = defField "toc" (writerTableOfContents options) $
130 defField "toc-depth" (show (writerTOCDepth options -
132 defField "toc-depth" (show (writerTOCDepth options -
131 if writerChapters options
133 if writerChapters options
132 then 1
134 then 1
133 else 0)) $
135 else 0)) $
134 defField "body" main $
136 defField "body" main $
135− defField "title-meta" (stringify $ docTitle meta) $
137+ defField "title-meta" titleMeta $
136− defField "author-meta" (intercalate "; " $ map stringify $ docAuthors meta) $
138+ defField "author-meta" (intercalate "; " authorsMeta) $
137 defField "documentclass" (if writerBeamer options
139 defField "documentclass" (if writerBeamer options
138 then ("beamer" :: String)
140 then ("beamer" :: String)
139 else if writerChapters options
141 else if writerChapters options