tagsoupSource codeContentsIndex
Text.HTML.TagSoup.Render
Description
This module converts a list of Tag back into a string.
Synopsis
renderTags :: StringLike str => [Tag str] -> str
renderTagsOptions :: StringLike str => RenderOptions str -> [Tag str] -> str
escapeHTML :: StringLike str => str -> str
data RenderOptions str = RenderOptions {
optEscape :: str -> str
optMinimize :: str -> Bool
}
renderOptions :: StringLike str => RenderOptions str
Documentation
renderTags :: StringLike str => [Tag str] -> strSource

Show a list of tags, as they might have been parsed, using the default settings given in RenderOptions.

 renderTags [TagOpen "hello" [],TagText "my&",TagClose "world"] == "<hello>my&amp;</world>"
renderTagsOptions :: StringLike str => RenderOptions str -> [Tag str] -> strSource

Show a list of tags using settings supplied by the RenderOptions parameter, eg. to avoid escaping any characters one could do:

 renderTagsOptions renderOptions{optEscape = id} [TagText "my&"] == "my&"
escapeHTML :: StringLike str => str -> strSource
Replace the four characters &"<> with their HTML entities.
data RenderOptions str Source

These options control how renderTags works.

The strange quirk of only minimizing <br> tags is due to Internet Explorer treating <br></br> as <br><br>.

Constructors
RenderOptions
optEscape :: str -> strEscape a piece of text (default = escape the four characters &"<>)
optMinimize :: str -> BoolMinimise <b></b> -> <b/> (default = minimise only <br> tags)
renderOptions :: StringLike str => RenderOptions strSource
The default render options value, described in RenderOptions.
Produced by Haddock version 2.4.2