This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "heist".
The branch, xmlhtml has been updated
via f6891e492f76640685976202d143817586c88cba (commit)
from a81f153aba6ed5e74224e47884d990e42bb84011 (commit)
Summary of changes:
src/Text/Templating/Heist/Internal.hs | 2 +-
src/Text/Templating/Heist/Splices/Markdown.hs | 14 +++++++++-----
test/suite/Text/Templating/Heist/Tests.hs | 4 ++--
3 files changed, 12 insertions(+), 8 deletions(-)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit f6891e492f76640685976202d143817586c88cba
Author: Mighty Byte <[email protected]>
Date: Sat Jan 8 16:31:45 2011 -0500
Added source as an argument to parseHTML.
diff --git a/src/Text/Templating/Heist/Internal.hs
b/src/Text/Templating/Heist/Internal.hs
index 0dccfaf..66f7a4e 100644
--- a/src/Text/Templating/Heist/Internal.hs
+++ b/src/Text/Templating/Heist/Internal.hs
@@ -491,7 +491,7 @@ getDoc f = do
bs <- catch (liftM Right $ B.readFile f)
(\(e::SomeException) -> return $ Left $ show e)
- let d = either Left X.parseHTML bs
+ let d = either Left (X.parseHTML f) bs
return $ mapLeft (\s -> f ++ " " ++ s) d
diff --git a/src/Text/Templating/Heist/Splices/Markdown.hs
b/src/Text/Templating/Heist/Splices/Markdown.hs
index b9755f4..9de2e2a 100644
--- a/src/Text/Templating/Heist/Splices/Markdown.hs
+++ b/src/Text/Templating/Heist/Splices/Markdown.hs
@@ -61,12 +61,16 @@ markdownSplice templatePath = do
when (isNothing pdMD) $ liftIO $ throwIO PandocMissingException
tree <- getParamNode
- markup <- liftIO $
+ (source,markup) <- liftIO $
case getAttribute "file" tree of
- Just f -> pandoc (fromJust pdMD) templatePath $ T.unpack f
- Nothing -> pandocBS (fromJust pdMD) $ T.encodeUtf8 $ nodeText tree
-
- let ee = parseHTML markup
+ Just f -> do
+ m <- pandoc (fromJust pdMD) templatePath $ T.unpack f
+ return (T.unpack f,m)
+ Nothing -> do
+ m <- pandocBS (fromJust pdMD) $ T.encodeUtf8 $ nodeText tree
+ return ("inline_splice",m)
+
+ let ee = parseHTML source markup
case ee of
Left e -> throw $ MarkdownException
$ BC.pack ("Error parsing markdown output: " ++ e)
diff --git a/test/suite/Text/Templating/Heist/Tests.hs
b/test/suite/Text/Templating/Heist/Tests.hs
index ebde482..8a1dace 100644
--- a/test/suite/Text/Templating/Heist/Tests.hs
+++ b/test/suite/Text/Templating/Heist/Tests.hs
@@ -169,10 +169,10 @@ doctypeTest = do
let ts = either (error "Error loading templates") id ets
index <- renderTemplate ts "index"
H.assertBool "doctype test index" $ isJust $
- X.docType $ fromRight $ X.parseHTML $ fromJust index
+ X.docType $ fromRight $ (X.parseHTML "index") $ fromJust index
ioc <- renderTemplate ts "ioc"
H.assertBool "doctype test ioc" $ isJust $
- X.docType $ fromRight $ X.parseHTML $ fromJust ioc
+ X.docType $ fromRight $ (X.parseHTML "index") $ fromJust ioc
where fromRight (Right x) = x
fromRight (Left s) = error s
-----------------------------------------------------------------------
hooks/post-receive
--
heist
_______________________________________________
Snap mailing list
[email protected]
http://mailman-mail5.webfaction.com/listinfo/snap