xmlModel rnc =
Leaf "xml-model" "<?xml-model" "?>\n" ()
! attribute "type" " type=\"" "application/relax-ng-compact-syntax"
- ! attribute "href" " href=\"" (attrValue rnc)
+ ! attribute "href" " href=\"" (attrify rnc)
xmlStylesheet :: Text -> DTC
xmlStylesheet xsl =
Leaf "xml-stylesheet" "<?xml-stylesheet" "?>\n" ()
! attribute "type" " type=\"" "text/xsl"
- ! attribute "href" " href=\"" (attrValue xsl)
+ ! attribute "href" " href=\"" (attrify xsl)
html5Stylesheet :: Text -> DTC
html5Stylesheet xsl =
Leaf "html5-stylesheet" "<?html5-stylesheet" "?>\n" ()
! attribute "type" " type=\"" "text/xsl"
- ! attribute "href" " href=\"" (attrValue xsl)
+ ! attribute "href" " href=\"" (attrify xsl)
atomStylesheet :: Text -> DTC
atomStylesheet xsl =
Leaf "atom-stylesheet" "<?atom-stylesheet" "?>\n" ()
! attribute "type" " type=\"" "text/xsl"
- ! attribute "href" " href=\"" (attrValue xsl)
+ ! attribute "href" " href=\"" (attrify xsl)
about :: DTC -> DTC
about = Parent "about" "<about" "</about>"
b = Parent "b" "<b" "</b>"
br :: DTC
br = Leaf "br" "<br" " />" ()
+break :: DTC
+break = Leaf "break" "<break" " />" ()
call :: DTC -> DTC
call = Parent "call" "<call" "</call>"
code :: DTC -> DTC
iref :: DTC -> DTC
iref (Empty a) = Leaf "iref" "<iref" "/>" a
iref x = Parent "iref" "<iref" "</iref>" x
-keyword :: DTC -> DTC
-keyword = Parent "keyword" "<keyword" "</keyword>"
li :: DTC -> DTC
li = Parent "li" "<li" "</li>"
link :: DTC -> DTC
ol = Parent "ol" "<ol" "</ol>"
organization :: DTC -> DTC
organization = Parent "organization" "<organization" "</organization>"
+p :: DTC -> DTC
+p = Parent "p" "<p" "</p>"
para :: DTC -> DTC
para = Parent "para" "<para" "</para>"
q :: DTC -> DTC
sub = Parent "sub" "<sub" "</sub>"
sup :: DTC -> DTC
sup = Parent "sup" "<sup" "</sup>"
+tag :: DTC -> DTC
+tag = Parent "tag" "<tag" "</tag>"
title :: DTC -> DTC
title = Parent "title" "<title" "</title>"
toc :: DTC
version :: DTC -> DTC
version = Parent "version" "<version" "</version>"
-indentTag :: Text -> IndentTag
-indentTag t =
- case t of
- "about" -> IndentTagChildren
- "address" -> IndentTagChildren
- "author" -> IndentTagChildren
- "document" -> IndentTagChildren
- "editor" -> IndentTagChildren
- "figure" -> IndentTagChildren
- "ol" -> IndentTagChildren
- "postal" -> IndentTagChildren
- "reference" -> IndentTagChildren
- "rl" -> IndentTagChildren
- "section" -> IndentTagChildren
- "ul" -> IndentTagChildren
- "a" -> IndentTagText
- "b" -> IndentTagText
- "i" -> IndentTagText
- "li" -> IndentTagText
- "para" -> IndentTagText
- "q" -> IndentTagText
- "quote" -> IndentTagText
- "note" -> IndentTagText
- _ -> IndentTagPreserve
+isInlinedElement :: Text -> Bool
+isInlinedElement = \case
+ "a" -> True
+ "b" -> True
+ "br" -> True
+ "code" -> True
+ "em" -> True
+ "i" -> True
+ "note" -> True
+ "q" -> True
+ "u" -> True
+ "sup" -> True
+ "sub" -> True
+ _ -> False