@@ -142,7 +142,7 @@ template = mconcat <$> P.many (P.choice [ lift chunk
142142 , lift escaped
143143 , conditional
144144 , for
145− , lift partial
145+ , partial
146146 , lift expr
147147 ])
148148 where lift = fmap (Template . (:[]))
@@ -246,12 +246,18 @@ for = P.try $ do
246246
247247
248248--------------------------------------------------------------------------------
249−partial :: P.Parser TemplateElement
249+partial :: P.Parser Template
250250partial = P.try $ do
251− void $ P.string "$partial("
251+ trimLPartial <- trimOpen
252+ void $ P.string "partial("
252253 e <- expr'
253− void $ P.string ")$"
254− return $ Partial e
254+ void $ P.char ')'
255+ trimRPartial <- trimClose
256+
257+ pure $ Template $ mconcat [ [TrimL | trimLPartial]
258+ , [Partial e]
259+ , [TrimR | trimRPartial]
260+ ]
255261
256262
257263--------------------------------------------------------------------------------