aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Krewinkel <[email protected]>2022-10-11 16:37:35 +0200
committerAlbert Krewinkel <[email protected]>2022-10-11 18:17:25 +0200
commit4a97f5799a4bf9b672202fbd95cdef6cc49f62f8 (patch)
treeb08dd584c185e6343c87daec9b623bd4d8c024a6
parent1612cc3bf400cb34eaee2dd207c936c9fcc412cb (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.hs3
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 ""