seonbi-0.4.0: SmartyPants for Korean language
Safe HaskellSafe-Inferred
LanguageHaskell2010

Text.Seonbi.Html.Tag

Synopsis

Documentation

data HtmlTag Source #

HTML tags. This enumeration type contains both HTML 5 and 4 tags for maximum compatibility.

Instances

Instances details
Show HtmlTag Source # 
Instance details

Defined in Text.Seonbi.Html.Tag

Eq HtmlTag Source # 
Instance details

Defined in Text.Seonbi.Html.Tag

Methods

(==) :: HtmlTag -> HtmlTag -> Bool #

(/=) :: HtmlTag -> HtmlTag -> Bool #

Ord HtmlTag Source # 
Instance details

Defined in Text.Seonbi.Html.Tag

headingLevel :: HtmlTag -> Maybe Int Source #

Get the heading level of an HtmlTag, if it is a heading tag (H1 to H6).

>>> headingLevel H1
Just 1
>>> headingLevel H6
Just 6
>>> headingLevel P
Nothing

headingTag :: Int -> Maybe HtmlTag Source #

Get the heading tag with the given heading level. If the level is invalid, then Nothing is returned.

>>> headingTag 1
Just H1
>>> headingTag 6
Just H6
>>> headingTag 7
Nothing

headingTag' :: Int -> HtmlTag Source #

Get the heading tag with the given heading level. If the level is greater than 6, then H6 is returned. If the level is less than 1, then H1 is returned.

>>> headingTag' 1
H1
>>> headingTag' 6
H6
>>> headingTag' 0
H1
>>> headingTag' 7
H6

htmlTagKind :: HtmlTag -> HtmlTagKind Source #

The kind of an HtmlTag.

>>> Data.Set.filter ((== EscapableRawText) . htmlTagKind) htmlTags
fromList [TextArea,Title]

htmlTagName :: HtmlTag -> Text Source #

The name of an HtmlTag in lowercase.

>>> htmlTagName TextArea
"textarea"
\ t -> htmlTagName t == (toLower $ pack $ show (t :: HtmlTag))

htmlTagNames :: Map Text HtmlTag Source #

The map of tag names to HtmlTag values.

>>> :set -XOverloadedStrings
>>> Data.Map.Strict.lookup "blockquote" htmlTagNames
Just BlockQuote
\ t -> Data.Map.Strict.lookup (htmlTagName t) htmlTagNames == Just t

htmlTags :: Set HtmlTag Source #

List all supported HTML tags.

>>> htmlTags
fromList [A,Abbr,Acronym,Address,...,UL,Var,Video,WBR,XMP]