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, master has been updated
       via  8d7d0f89fd6bc4e79c45ab45eb9b5ddf89f4bac1 (commit)
      from  b00641a4756c864b909a7b8d15af7ea29f672a86 (commit)


Summary of changes:
 CONTRIBUTORS                          |    1 +
 src/Text/Templating/Heist/Internal.hs |   11 ++++++++---
 2 files changed, 9 insertions(+), 3 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 8d7d0f89fd6bc4e79c45ab45eb9b5ddf89f4bac1
Author: Shane <[email protected]>
Date:   Mon Jun 14 18:24:19 2010 +0100

    Changed $() attribute substitution to evaluate to concatenation of the 
first few text nodes of the splice, to allow for the substitution of HTML 
entities.

diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index 528d632..3c59f85 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -2,4 +2,5 @@ Doug Beardsley <[email protected]>
 Gregory Collins <[email protected]>
 Carl Howells
 Edward Kmett
+Shane O'Brien <[email protected]>
 James Sanders <[email protected]>
diff --git a/src/Text/Templating/Heist/Internal.hs 
b/src/Text/Templating/Heist/Internal.hs
index 1900ac1..80f013f 100644
--- a/src/Text/Templating/Heist/Internal.hs
+++ b/src/Text/Templating/Heist/Internal.hs
@@ -284,15 +284,20 @@ attParser = AP.many1 (identParser <|> litParser)
 
 ------------------------------------------------------------------------------
 -- | Get's the attribute value.  This is just a normal splice lookup with the
--- added restriction that the splice's result list has to contain a single
--- text element.  Otherwise the attribute evaluates to the empty string.
+-- added restriction that the splice's result list has to start with a list
+-- of text elements.  Otherwise the attribute evaluates to the empty string.
+--
+-- This originally only took the first text node. However, because HTML 
+-- entities will split a text node, and it might be desirable to have text
+-- containing HTML entities in an attribute, it was decided instead to to
+-- take the first few consecutive text nodes and concatenate them instead.
 getAttributeSplice :: Monad m => ByteString -> TemplateMonad m ByteString
 getAttributeSplice name = do
     s <- liftM (lookupSplice name) getTS
     nodes <- maybe (return []) id s
     return $ check nodes
   where
-    check ((X.Text t):_) = t
+    check ((X.Text t):xs) = B.append t $ check xs
     check _ = ""
 
 ------------------------------------------------------------------------------
-----------------------------------------------------------------------


hooks/post-receive
-- 
heist
_______________________________________________
Snap mailing list
[email protected]
http://mailman-mail5.webfaction.com/listinfo/snap

Reply via email to