@@ -134,6 +134,7 @@ data Opt = Opt
134 , optLaTeXEngine :: String -- ^ Program to use for latex -> pdf
134 , optLaTeXEngine :: String -- ^ Program to use for latex -> pdf
135 , optSlideLevel :: Maybe Int -- ^ Header level that creates slides
135 , optSlideLevel :: Maybe Int -- ^ Header level that creates slides
136 , optSetextHeaders :: Bool -- ^ Use atx headers for markdown level 1-2
136 , optSetextHeaders :: Bool -- ^ Use atx headers for markdown level 1-2
137+ , optAscii :: Bool -- ^ Use ascii characters only in html
139-- | Defaults for command-line options.
140-- | Defaults for command-line options.
@@ -185,6 +186,7 @@ defaultOpts = Opt
185 , optLaTeXEngine = "pdflatex"
186 , optLaTeXEngine = "pdflatex"
186 , optSlideLevel = Nothing
187 , optSlideLevel = Nothing
187 , optSetextHeaders = True
188 , optSetextHeaders = True
190-- | A list of functions, each transforming the options data structure
192-- | A list of functions, each transforming the options data structure
@@ -412,6 +414,11 @@ options =
412 return opt { optHtml5 = True }))
414 return opt { optHtml5 = True }))
413 "" -- "Produce HTML5 in HTML output"
415 "" -- "Produce HTML5 in HTML output"
417+ , Option "" ["ascii"]
419+ (\opt -> return opt { optAscii = True }))
420+ "" -- "Use ascii characters only in HTML output"
415 , Option "" ["reference-links"]
422 , Option "" ["reference-links"]
417 (\opt -> return opt { optReferenceLinks = True } ))
424 (\opt -> return opt { optReferenceLinks = True } ))
@@ -796,6 +803,7 @@ main = do
796 , optLaTeXEngine = latexEngine
803 , optLaTeXEngine = latexEngine
797 , optSlideLevel = slideLevel
804 , optSlideLevel = slideLevel
798 , optSetextHeaders = setextHeaders
805 , optSetextHeaders = setextHeaders
801 when dumpArgs $
809 when dumpArgs $
@@ -1027,10 +1035,15 @@ main = do
1027 case res of
1035 case res of
1028 Right pdf -> writeBinary pdf
1036 Right pdf -> writeBinary pdf
1029 Left err' -> err 43 $ toString err'
1037 Left err' -> err 43 $ toString err'
1039+ | htmlFormat && ascii ->
1040+ writerFn outputFile =<< selfcontain (toEntities result)
1030− Just r -> writerFn outputFile =<< postProcess result
1042+ writerFn outputFile =<< selfcontain result
1031 where result = r writerOptions doc2 ++ ['\n' | not standalone']
1043 where result = r writerOptions doc2 ++ ['\n' | not standalone']
1044+ htmlFormat = writerName' `elem`
1032− htmlFormats = ["html","html+lhs","html5","html5+lhs",
1045+ ["html","html+lhs","html5","html5+lhs",
1033 "s5","slidy","dzslides"]
1046 "s5","slidy","dzslides"]
1034− postProcess = if selfContained && writerName' `elem` htmlFormats
1047+ selfcontain = if selfContained && htmlFormat
1035− then makeSelfContained datadir
1048+ then makeSelfContained datadir
1036− else return
1049+ else return