From a854a180416ffa6e1f45023025924fab3161a993 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sun, 20 May 2012 10:54:28 +0200 Subject: Imported Upstream version 1.9.3 --- src/pandoc.hs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/pandoc.hs') diff --git a/src/pandoc.hs b/src/pandoc.hs index dab7b4161..a25e7d8d6 100644 --- a/src/pandoc.hs +++ b/src/pandoc.hs @@ -135,6 +135,7 @@ data Opt = Opt , optSlideLevel :: Maybe Int -- ^ Header level that creates slides , optSetextHeaders :: Bool -- ^ Use atx headers for markdown level 1-2 , optAscii :: Bool -- ^ Use ascii characters only in html + , optTeXLigatures :: Bool -- ^ Use TeX ligatures for quotes/dashes } -- | Defaults for command-line options. @@ -187,6 +188,7 @@ defaultOpts = Opt , optSlideLevel = Nothing , optSetextHeaders = True , optAscii = False + , optTeXLigatures = True } -- | A list of functions, each transforming the options data structure @@ -438,6 +440,11 @@ options = (\opt -> return opt { optNumberSections = True })) "" -- "Number sections in LaTeX" + , Option "" ["no-tex-ligatures"] + (NoArg + (\opt -> return opt { optTeXLigatures = False })) + "" -- "Don't use tex ligatures for quotes, dashes" + , Option "" ["listings"] (NoArg (\opt -> return opt { optListings = True })) @@ -689,6 +696,7 @@ defaultReaderName fallback (x:xs) = ".ltx" -> "latex" ".rst" -> "rst" ".lhs" -> "markdown+lhs" + ".db" -> "docbook" ".textile" -> "textile" ".native" -> "native" ".json" -> "json" @@ -803,6 +811,7 @@ main = do , optSlideLevel = slideLevel , optSetextHeaders = setextHeaders , optAscii = ascii + , optTeXLigatures = texLigatures } = opts when dumpArgs $ @@ -917,7 +926,8 @@ main = do lhsExtension sources, stateStandalone = standalone', stateCitations = map CSL.refId refs, - stateSmart = smart || laTeXOutput || writerName' == "context", + stateSmart = smart || (texLigatures && + (laTeXOutput || writerName' == "context")), stateOldDashes = oldDashes, stateColumns = columns, stateStrict = strict, @@ -960,7 +970,8 @@ main = do writerSlideLevel = slideLevel, writerHighlight = highlight, writerHighlightStyle = highlightStyle, - writerSetextHeaders = setextHeaders + writerSetextHeaders = setextHeaders, + writerTeXLigatures = texLigatures } when (writerName' `elem` nonTextFormats&& outputFile == "-") $ -- cgit v1.2.3