@@ -134,6 +134,7 @@ data Opt = Opt
134134 , optLaTeXEngine :: String -- ^ Program to use for latex -> pdf
135135 , optSlideLevel :: Maybe Int -- ^ Header level that creates slides
136136 , optSetextHeaders :: Bool -- ^ Use atx headers for markdown level 1-2
137+ , optAscii :: Bool -- ^ Use ascii characters only in html
137138 }
138139
139140-- | Defaults for command-line options.
@@ -185,6 +186,7 @@ defaultOpts = Opt
185186 , optLaTeXEngine = "pdflatex"
186187 , optSlideLevel = Nothing
187188 , optSetextHeaders = True
189+ , optAscii = False
188190 }
189191
190192-- | A list of functions, each transforming the options data structure
@@ -412,6 +414,11 @@ options =
412414 return opt { optHtml5 = True }))
413415 "" -- "Produce HTML5 in HTML output"
414416
417+ , Option "" ["ascii"]
418+ (NoArg
419+ (\opt -> return opt { optAscii = True }))
420+ "" -- "Use ascii characters only in HTML output"
421+
415422 , Option "" ["reference-links"]
416423 (NoArg
417424 (\opt -> return opt { optReferenceLinks = True } ))
@@ -796,6 +803,7 @@ main = do
796803 , optLaTeXEngine = latexEngine
797804 , optSlideLevel = slideLevel
798805 , optSetextHeaders = setextHeaders
806+ , optAscii = ascii
799807 } = opts
800808
801809 when dumpArgs $
@@ -1027,10 +1035,15 @@ main = do
10271035 case res of
10281036 Right pdf -> writeBinary pdf
10291037 Left err' -> err 43 $ toString err'
1030− Just r -> writerFn outputFile =<< postProcess result
1038+ Just r
1039+ | htmlFormat && ascii ->
1040+ writerFn outputFile =<< selfcontain (toEntities result)
1041+ | otherwise ->
1042+ writerFn outputFile =<< selfcontain result
10311043 where result = r writerOptions doc2 ++ ['\n' | not standalone']
1032− htmlFormats = ["html","html+lhs","html5","html5+lhs",
1044+ htmlFormat = writerName' `elem`
1045+ ["html","html+lhs","html5","html5+lhs",
10331046 "s5","slidy","dzslides"]
1034− postProcess = if selfContained && writerName' `elem` htmlFormats
1035− then makeSelfContained datadir
1036− else return
1047+ selfcontain = if selfContained && htmlFormat
1048+ then makeSelfContained datadir
1049+ else return