| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Text.Ginger.Html
Description
A HTML type, useful for implementing type-safe conversion between plain
text and HTML.
The HTML representation used here assumed Unicode throughout, and UTF-8
should be used as the encoding when sending Html objects as responses to a
HTTP client.
Documentation
A chunk of HTML source.
Instances
| Eq Html Source # | |
| Ord Html Source # | |
| Show Html Source # | |
| Semigroup Html Source # | |
| Monoid Html Source # | |
| ToHtml Html Source # | Html itself is a trivial instance |
| ContextEncodable Html Source # | Encoding to Html is implemented as returning the |
| ToGVal m Html Source # | This instance is slightly wrong; the It is therefore recommended to avoid passing |
unsafeRawHtml :: Text -> Html Source #
Convert a chunk of HTML source code into an Html value as-is. Note that
this bypasses any and all HTML encoding; the caller is responsible for
taking appropriate measures against XSS and other potential vulnerabilities.
In other words, the input to this function is considered pre-sanitized.
htmlSource :: Html -> Text Source #
Extract HTML source code from an Html value.
Types that support conversion to HTML.
Instances
| ToHtml Text Source # | Text is automatically HTML-encoded |
| ToHtml Html Source # | Html itself is a trivial instance |
| ToHtml [Char] Source # | String is automatically HTML-encoded and converted to |
| ToHtml (GVal m) Source # | Converting to HTML hooks into the ToHtml instance for |