diff options
| author | Albert Krewinkel <[email protected]> | 2022-10-07 21:16:45 +0200 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2022-10-08 16:05:48 -0700 |
| commit | a4218b9719c77978e1968065a3c2c4f25d3c4137 (patch) | |
| tree | 2335115e82577031786f766a122ae400ac3dcc5a /pandoc-server/src/Text | |
| parent | e663bb0e1479dac2638a3e4f693e5eeac314e347 (diff) | |
[API Change] Add new module "Text.Pandoc.Format"
The module provides functions and types for format spec parsing and
processing.
The function `parseFormatSpec` was moved from Text.Pandoc.Extensions to
the new module and renamed to `parseFlavoredFormat`. It now operates in
a PandocMonad and is based on the updated types.
Diffstat (limited to 'pandoc-server/src/Text')
| -rw-r--r-- | pandoc-server/src/Text/Pandoc/Server.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pandoc-server/src/Text/Pandoc/Server.hs b/pandoc-server/src/Text/Pandoc/Server.hs index 940606deb..2f43a8561 100644 --- a/pandoc-server/src/Text/Pandoc/Server.hs +++ b/pandoc-server/src/Text/Pandoc/Server.hs @@ -27,7 +27,6 @@ import qualified Data.Text as T import qualified Data.Text.Lazy as TL import qualified Data.Text.Lazy.Encoding as TLE import Data.Maybe (fromMaybe) -import Data.Char (isAlphaNum) import qualified Data.ByteString as BS import qualified Data.ByteString.Lazy as BL import Data.ByteString.Base64 (decodeBase64, encodeBase64) @@ -44,6 +43,7 @@ import Text.Pandoc.Shared (safeStrRead, headerShift, filterIpynbOutput, eastAsianLineBreakFilter) import Text.Pandoc.App ( IpynbOutput (..), Opt(..), defaultOpts ) import Text.Pandoc.Builder (setMeta) +import Text.Pandoc.Format (parseFlavoredFormat, formatName) import Text.Pandoc.SelfContained (makeSelfContained) import System.Exit import GHC.Generics (Generic) @@ -270,7 +270,7 @@ server = convertBytes (writerSpec, writerExts) <- getWriter writerFormat let isStandalone = optStandalone opts - let toformat = T.toLower $ T.takeWhile isAlphaNum $ writerFormat + toformat <- formatName <$> parseFlavoredFormat writerFormat hlStyle <- traverse (lookupHighlightingStyle . T.unpack) $ optHighlightStyle opts |
