aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-10-08 21:45:39 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2018-10-08 21:45:39 -0700
commit6d87af888296fefc940ef121732a212d1e71d67d (patch)
tree2316192293e78a96c7fb6a5ae504ff62a91afb11 /src/Text
parentf8879ee0a1f00bcf1ead9dce0576c381cbcae778 (diff)
downloadpandoc-6d87af888296fefc940ef121732a212d1e71d67d.tar.gz
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.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs5
1 files changed, 4 insertions, 1 deletions
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 ])