@@ -64,6 +64,8 @@ data TemplateElement
6464 | If TemplateExpr Template (Maybe Template) -- expr, then, else
6565 | For TemplateExpr Template (Maybe Template) -- expr, body, separator
6666 | Partial TemplateExpr -- filename
67+ | TrimL
68+ | TrimR
6769 deriving (Show, Eq, Typeable)
6870
6971
@@ -71,10 +73,12 @@ data TemplateElement
7173instance Binary TemplateElement where
7274 put (Chunk string) = putWord8 0 >> put string
7375 put (Expr e) = putWord8 1 >> put e
74− put (Escaped) = putWord8 2
75− put (If e t f ) = putWord8 3 >> put e >> put t >> put f
76+ put Escaped = putWord8 2
77+ put (If e t f) = putWord8 3 >> put e >> put t >> put f
7678 put (For e b s) = putWord8 4 >> put e >> put b >> put s
7779 put (Partial e) = putWord8 5 >> put e
80+ put TrimL = putWord8 6
81+ put TrimR = putWord8 7
7882
7983 get = getWord8 >>= \tag -> case tag of
8084 0 -> Chunk <$> get
@@ -83,8 +87,9 @@ instance Binary TemplateElement where
8387 3 -> If <$> get <*> get <*> get
8488 4 -> For <$> get <*> get <*> get
8589 5 -> Partial <$> get
86− _ -> error $
87− "Hakyll.Web.Template.Internal: Error reading cached template"
90+ 6 -> pure TrimL
91+ 7 -> pure TrimR
92+ _ -> error "Hakyll.Web.Template.Internal: Error reading cached template"
8893
8994
9095--------------------------------------------------------------------------------
@@ -114,8 +119,7 @@ instance Binary TemplateExpr where
114119 0 -> Ident <$> get
115120 1 -> Call <$> get <*> get
116121 2 -> StringLiteral <$> get
117− _ -> error $
118− "Hakyll.Web.Tamplte.Internal: Error reading cached template"
122+ _ -> error "Hakyll.Web.Template.Internal: Error reading cached template"
119123
120124
121125--------------------------------------------------------------------------------