Skip to content

Commit

Permalink
Modify fix to #6742 to use stringToLaTeX.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgm committed Oct 14, 2020
1 parent f415723 commit 0b3b774
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Text/Pandoc/Writers/LaTeX.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE PatternGuards #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE ViewPatterns #-}
Expand Down Expand Up @@ -635,7 +636,8 @@ blockToLaTeX (CodeBlock (identifier,classes,keyvalAttr) str) = do
let listingsCodeBlock = do
st <- get
ref <- toLabel identifier
let esc = escapeStringUsing (backslashEscapes "\\{}%~_&#^")
kvs <- mapM (\(k,v) -> (k,) <$>
stringToLaTeX TextString v) keyvalAttr
let params = if writerListings (stOptions st)
then (case getListingsLanguage classes of
Just l -> [ "language=" <> mbBraced l ]
Expand All @@ -645,8 +647,8 @@ blockToLaTeX (CodeBlock (identifier,classes,keyvalAttr) str) = do
|| "number-lines" `elem` classes ] ++
[ (if key == "startFrom"
then "firstnumber"
else key) <> "=" <> mbBraced (esc attr) |
(key,attr) <- keyvalAttr,
else key) <> "=" <> mbBraced attr |
(key,attr) <- kvs,
key `notElem` ["exports", "tangle", "results"]
-- see #4889
] ++
Expand Down

0 comments on commit 0b3b774

Please sign in to comment.