+ link@(ExternalLink _ _)
+ -> formatExternalLink -< link
+
+ LineBreak attrs
+ -> formatElem "br" -< (baseURI, attrs, [])
+
+ Span attrs contents
+ -> formatElem "span" -< (baseURI, attrs, contents)
+
+ Image attrs
+ -> formatElem "img" -< (baseURI, attrs, [])
+
+ Anchor attrs contents
+ -> formatElem "a" -< (baseURI, attrs, contents)
+
+ EmptyInline
+ -> none -< ()
+ where
+ formatElem :: (ArrowXml a, ArrowChoice a) =>
+ String
+ -> a (URI, [Attribute], [InlineElement]) XmlTree
+ formatElem name
+ = proc (baseURI, attrs, contents)
+ -> ( eelem name
+ += ( arrL (fst . snd)
+ >>>
+ attrFromPair
+ )
+ += ( (arr fst &&& arrL (snd . snd))
+ >>>
+ formatInline
+ )
+ ) -< (baseURI, (attrs, contents))
+
+
+attrFromPair :: (ArrowXml a) => a (String, String) XmlTree
+attrFromPair = proc (name, value)
+ -> attr name (txt value) -<< ()
+