Skip to content

Commit

Permalink
Don't escape single quote (') as &jaspervdj#39;.
Browse files Browse the repository at this point in the history
Argument:  The only context in which ' needs to be escaped is inside
a single-quoted attribute value.  Since blaze-html uses double
quotes around attribute values, it should never need to escape '.
  • Loading branch information
jgm committed Dec 18, 2011
1 parent c614fb8 commit e42848d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 2 deletions.
1 change: 0 additions & 1 deletion Text/Blaze/Renderer/String.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ escapeHtmlEntities (c:cs) k = case c of
'>' -> '&' : 'g' : 't' : ';' : escapeHtmlEntities cs k
'&' -> '&' : 'a' : 'm' : 'p' : ';' : escapeHtmlEntities cs k
'"' -> '&' : 'q' : 'u' : 'o' : 't' : ';' : escapeHtmlEntities cs k
'\'' -> '&' : '#' : '3' : '9' : ';' : escapeHtmlEntities cs k
x -> x : escapeHtmlEntities cs k

-- | Render a 'ChoiceString'.
Expand Down
1 change: 0 additions & 1 deletion Text/Blaze/Renderer/Text.hs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ escapeHtmlEntities = T.foldr escape mempty
escape '>' b = B.fromText ">" `mappend` b
escape '&' b = B.fromText "&" `mappend` b
escape '"' b = B.fromText """ `mappend` b
escape '\'' b = B.fromText "'" `mappend` b
escape x b = B.singleton x `mappend` b

-- | Render a 'ChoiceString'. TODO: Optimization possibility, apply static
Expand Down

0 comments on commit e42848d

Please sign in to comment.