Safe HaskellNone

IHP.HtmlSupport.Parser

Synopsis

Documentation

parseHsx :: SourcePos -> Text -> Either (ParseErrorBundle Text Void) Node Source #

Parses a HSX text and returns a Node

Example:

let filePath = "my-template"
let line = 0
let col = 0
let position = Megaparsec.SourcePos filePath (Megaparsec.mkPos line) (Megaparsec.mkPos col)
let hsxText = "<strong>Hello</strong>"

let (Right node) = parseHsx position hsxText

data Node Source #

Constructors

Node !Text ![Attribute] ![Node] 
TextNode !Text 
PreEscapedTextNode !Text

Used in script or style bodies

SplicedNode !Text

Inline haskell expressions like {myVar} or {f "hello"}

Children ![Node] 
CommentNode !Text 

Instances

Instances details
Eq Node Source # 
Instance details

Defined in IHP.HtmlSupport.Parser

Methods

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

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

Show Node Source # 
Instance details

Defined in IHP.HtmlSupport.Parser

Methods

showsPrec :: Int -> Node -> ShowS #

show :: Node -> String

showList :: [Node] -> ShowS #

data Attribute Source #

Instances

Instances details
Eq Attribute Source # 
Instance details

Defined in IHP.HtmlSupport.Parser

Show Attribute Source # 
Instance details

Defined in IHP.HtmlSupport.Parser

Methods

showsPrec :: Int -> Attribute -> ShowS #

show :: Attribute -> String

showList :: [Attribute] -> ShowS #

data AttributeValue Source #

Instances

Instances details
Eq AttributeValue Source # 
Instance details

Defined in IHP.HtmlSupport.Parser

Show AttributeValue Source # 
Instance details

Defined in IHP.HtmlSupport.Parser