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 7a8bb23 commit 4f51bce
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 @@ -252,9 +252,8 @@ instance ToMustache (STree -> SubM Text) where
return $ ASTree [TextBlock text] text

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 4f51bce

Please sign in to comment.