diff options
| author | John MacFarlane <jgm@berkeley.edu> | 2019-10-06 23:15:52 -0700 |
|---|---|---|
| committer | John MacFarlane <jgm@berkeley.edu> | 2019-10-06 23:15:52 -0700 |
| commit | 3ef0cdd8f9dafcd9e4b5c1e5f82e31bed0c3d847 (patch) | |
| tree | 6bcaefca929861490541e1a9d853809e59076882 /src/Text/Pandoc/App/OutputSettings.hs | |
| parent | 5f8254c4b903a0512b4b25a252dfd153d7f4230d (diff) | |
Opt: Change optHighlightStyle to a Maybe String instead of Maybe Style.
Do the parsing/loading of themes later, after option parsing.
Diffstat (limited to 'src/Text/Pandoc/App/OutputSettings.hs')
| -rw-r--r-- | src/Text/Pandoc/App/OutputSettings.hs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Text/Pandoc/App/OutputSettings.hs b/src/Text/Pandoc/App/OutputSettings.hs index cfb6f7ec2..04ea89eda 100644 --- a/src/Text/Pandoc/App/OutputSettings.hs +++ b/src/Text/Pandoc/App/OutputSettings.hs @@ -35,7 +35,7 @@ import System.IO (stdout) import Text.Pandoc import Text.Pandoc.App.FormatHeuristics (formatFromFilePaths) import Text.Pandoc.App.Opt (Opt (..)) -import Text.Pandoc.App.CommandLineOptions (engines) +import Text.Pandoc.App.CommandLineOptions (engines, lookupHighlightStyle) import Text.Pandoc.BCP47 (Lang (..), parseBCP47) import qualified Text.Pandoc.UTF8 as UTF8 @@ -105,6 +105,9 @@ optToOutputSettings opts = do syntaxMap <- foldM addSyntaxMap defaultSyntaxMap (optSyntaxDefinitions opts) + hlStyle <- maybe (return Nothing) (fmap Just . lookupHighlightStyle) + (optHighlightStyle opts) + -- note: this reverses the list constructed in option parsing, -- which in turn was reversed from the command-line order, -- so we end up with the correct order in the variable list: @@ -221,7 +224,7 @@ optToOutputSettings opts = do , writerTopLevelDivision = optTopLevelDivision opts , writerListings = optListings opts , writerSlideLevel = optSlideLevel opts - , writerHighlightStyle = optHighlightStyle opts + , writerHighlightStyle = hlStyle , writerSetextHeaders = optSetextHeaders opts , writerEpubSubdirectory = optEpubSubdirectory opts , writerEpubMetadata = epubMetadata |
