Skip to content

Commit

Permalink
Pass raw template text to lambda
Browse files Browse the repository at this point in the history
  • Loading branch information
brandon-leapyear committed Feb 26, 2021
1 parent 485b9ec commit e0d09ac
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Text/Mustache/Render.hs
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,8 @@ instance ToMustache (STree -> SubM Text) where
--
-- See: https://github.com/mustache/spec/blob/master/specs/~lambdas.yml
instance ToMustache (Text -> Text) where
toMustache f = Lambda $ \_ -> do
let text = undefined
result = f text
toMustache f = Lambda $ \tree -> do
let result = f $ rawText tree

case parse "lambda" result of
Right tree' -> return tree'
Expand Down

0 comments on commit e0d09ac

Please sign in to comment.