X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=Rakka%2FWiki%2FFormatter.hs;h=8a9dc1778eb43ca248a8ba75b52b638f67b0bcaa;hb=f832f12703d807f5fc3350dc71d8624ffc5b97a5;hp=7a6bde3bc81c631573bac749f5b933f504e2e281;hpb=2ad43b49ecc25bdf87dd19037fd63c12428992ae;p=Rakka.git diff --git a/Rakka/Wiki/Formatter.hs b/Rakka/Wiki/Formatter.hs index 7a6bde3..8a9dc17 100644 --- a/Rakka/Wiki/Formatter.hs +++ b/Rakka/Wiki/Formatter.hs @@ -44,11 +44,25 @@ formatBlock Paragraph inlines -> formatParagraph -< (baseURI, inlines) + Div attrs contents + -> ( eelem "div" + += ( arrL (fst . snd) + >>> + attrFromPair + ) + += ( (arr fst &&& arrL (snd . snd)) + >>> + formatBlock + ) + ) -< (baseURI, (attrs, contents)) + formatHeading :: ArrowXml a => a (Int, String) XmlTree formatHeading = proc (level, text) - -> selem ("h" ++ show level) [txt text] -<< () + -> mkelem ("h" ++ show level) + [ sattr "id" text ] + [ txt text ] -<< () formatListElement :: (ArrowXml a, ArrowChoice a) => a (URI, ListElement) XmlTree @@ -158,6 +172,18 @@ formatInline += (arrL id >>> attrFromPair) ) -< attrs + Span attrs contents + -> ( eelem "span" + += ( arrL (fst . snd) + >>> + attrFromPair + ) + += ( (arr fst &&& arrL (snd . snd)) + >>> + formatInline + ) + ) -< (baseURI, (attrs, contents)) + attrFromPair :: (ArrowXml a) => a (String, String) XmlTree attrFromPair = proc (name, value)