diff options
| author | Albert Krewinkel <[email protected]> | 2022-10-11 16:37:35 +0200 |
|---|---|---|
| committer | Albert Krewinkel <[email protected]> | 2022-10-11 18:17:25 +0200 |
| commit | 4a97f5799a4bf9b672202fbd95cdef6cc49f62f8 (patch) | |
| tree | b08dd584c185e6343c87daec9b623bd4d8c024a6 | |
| parent | 1612cc3bf400cb34eaee2dd207c936c9fcc412cb (diff) | |
Templates: do not try to normalize input to `getDefaultTemplate`
The function `getDefaultTemplate` no longer splits off extension
modifers from the given format, as that conflicts with using custom
writers as formats. Haskell library users should use `getDefaultTemplate
<=< (fmap formatName . parseFlavoredFormat)` if the input format can
still contain extensions. The same is true for `compileDefaultTemplate`,
which calls `getDefaultTemplate` internally.
| -rw-r--r-- | src/Text/Pandoc/Templates.hs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Templates.hs b/src/Text/Pandoc/Templates.hs index 173df273c..469401c97 100644 --- a/src/Text/Pandoc/Templates.hs +++ b/src/Text/Pandoc/Templates.hs @@ -81,8 +81,7 @@ getTemplate tp = UTF8.toText <$> getDefaultTemplate :: PandocMonad m => Text -- ^ Name of writer -> m Text -getDefaultTemplate writer = do - let format = T.takeWhile (`notElem` ("+-" :: String)) writer -- strip off extensions +getDefaultTemplate format = do case format of "native" -> return "" "csljson" -> return "" |
