From 6d87af888296fefc940ef121732a212d1e71d67d Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 8 Oct 2018 21:45:39 -0700 Subject: LaTeX writer with `--listings`: don't pass through org-babel attributes. So far: just, tangle, exports, results which are used by org mode. It might be better to use a whitelist of legal listings attributes, but there are a large number, and these may change. Closes #4889. --- src/Text/Pandoc/Writers/LaTeX.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/Text/Pandoc/Writers') diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index 891c20f07..11d58b90a 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -655,7 +655,10 @@ blockToLaTeX (CodeBlock (identifier,classes,keyvalAttr) str) = do [ (if key == "startFrom" then "firstnumber" else key) ++ "=" ++ mbBraced attr | - (key,attr) <- keyvalAttr ] ++ + (key,attr) <- keyvalAttr, + key `notElem` ["exports", "tangle", "results"] + -- see #4889 + ] ++ (if identifier == "" then [] else [ "label=" ++ ref ]) -- cgit v1.2.3