atomLink and sanitizeBalance
This commit is contained in:
parent
5978b71559
commit
97819f0ad7
@ -12,7 +12,7 @@ import Yesod.Handler
|
||||
import Yesod.Form.Core
|
||||
import Yesod.Hamlet
|
||||
import Yesod.Widget
|
||||
import Text.HTML.SanitizeXSS (sanitizeXSS)
|
||||
import Text.HTML.SanitizeXSS (sanitizeBalance)
|
||||
|
||||
import Yesod.Internal (lbsToChars)
|
||||
|
||||
@ -32,7 +32,7 @@ maybeNicHtmlField = optionalFieldHelper nicHtmlFieldProfile
|
||||
|
||||
nicHtmlFieldProfile :: YesodNic y => FieldProfile sub y Html
|
||||
nicHtmlFieldProfile = FieldProfile
|
||||
{ fpParse = Right . preEscapedString . sanitizeXSS
|
||||
{ fpParse = Right . preEscapedString . sanitizeBalance
|
||||
, fpRender = lbsToChars . renderHtml
|
||||
, fpWidget = \theId name val _isReq -> do
|
||||
addHtml [$hamlet|%textarea.html#$theId$!name=$name$ $val$|]
|
||||
|
||||
@ -24,7 +24,7 @@ import Data.Time (Day, TimeOfDay(..))
|
||||
import qualified Text.Email.Validate as Email
|
||||
import Network.URI (parseURI)
|
||||
import Database.Persist (PersistField)
|
||||
import Text.HTML.SanitizeXSS (sanitizeXSS)
|
||||
import Text.HTML.SanitizeXSS (sanitizeBalance)
|
||||
|
||||
import Text.Blaze.Builder.Utf8 (writeChar)
|
||||
import Text.Blaze.Builder.Core (writeList, writeByteString)
|
||||
@ -74,7 +74,7 @@ timeFieldProfile = FieldProfile
|
||||
|
||||
htmlFieldProfile :: FieldProfile sub y Html
|
||||
htmlFieldProfile = FieldProfile
|
||||
{ fpParse = Right . preEscapedString . sanitizeXSS
|
||||
{ fpParse = Right . preEscapedString . sanitizeBalance
|
||||
, fpRender = lbsToChars . renderHtml
|
||||
, fpWidget = \theId name val _isReq -> addHamlet [$hamlet|
|
||||
%textarea.html#$theId$!name=$name$ $val$
|
||||
|
||||
@ -19,6 +19,7 @@ module Yesod.Helpers.AtomFeed
|
||||
( AtomFeed (..)
|
||||
, AtomFeedEntry (..)
|
||||
, atomFeed
|
||||
, atomLink
|
||||
, RepAtom (..)
|
||||
) where
|
||||
|
||||
@ -69,3 +70,11 @@ entryTemplate arg = [$xhamlet|
|
||||
%title $atomEntryTitle.arg$
|
||||
%content!type=html $cdata.atomEntryContent.arg$
|
||||
|]
|
||||
|
||||
-- | Generates a link tag in the head of a widget.
|
||||
atomLink :: Route m
|
||||
-> String -- ^ title
|
||||
-> GWidget s m ()
|
||||
atomLink u title = addHamletHead [$hamlet|
|
||||
%link!href=@u@!type="application/atom+xml"!rel="alternate"!title=$title$
|
||||
|]
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
name: yesod
|
||||
version: 0.6.0.2
|
||||
version: 0.6.1
|
||||
license: BSD3
|
||||
license-file: LICENSE
|
||||
author: Michael Snoyman <michael@snoyman.com>
|
||||
@ -44,7 +44,7 @@ library
|
||||
, network >= 2.2.1.5 && < 2.3
|
||||
, email-validate >= 0.2.5 && < 0.3
|
||||
, web-routes >= 0.23 && < 0.24
|
||||
, xss-sanitize >= 0.2 && < 0.3
|
||||
, xss-sanitize >= 0.2.3 && < 0.3
|
||||
, data-default >= 0.2 && < 0.3
|
||||
, failure >= 0.1 && < 0.2
|
||||
, containers >= 0.2 && < 0.5
|
||||
|
||||
Loading…
Reference in New Issue
Block a user