- ex xs
-
-ex2 [] = []
-ex2 ((Paragraph):xs) = "<p>"++ex2 xs
-ex2 ((Text s):xs) = s++ex2 xs
-ex2 ((Link l d):xs) = "<link: "++l++" desc: "++d++">"++ex2 xs
-
-
-test s = case parse wikiParser "" s of
- Right n -> do
- print (ex2 n)
- Left e -> do
- print e
+ toWash xs
+toWash ((Bold d):xs) = do
+ b (toWash d)
+ toWash xs
+toWash ((Emph d):xs) = do
+ em (toWash d)
+ toWash xs
+toWash ((Underline d):xs) = do
+ u (toWash d)
+ toWash xs
+toWash ((Strike d):xs) = do
+ strike (toWash d)
+ toWash xs
+toWash ((Heading n d):xs) = do
+ heading n $ toWash d
+ toWash xs
+toWash ((Url l):xs) = do
+ hlink (URL {unURL = (l)}) (text $ stripMailto l)
+ toWash xs
+toWash ((Pre s):xs) = do
+ pre $ text s
+ toWash xs
+toWash ((List o l):xs) = do
+ listType o $ mapM (\s -> li $ toWash s) l
+ toWash xs
+
+listType True = ol
+listType False = ul
+
+stripMailto ('m':'a':'i':'l':'t':'o':':':xs) = xs
+stripMailto xs = xs
+
+heading 1 = h1
+heading 2 = h2
+heading 3 = h3
+heading 4 = h4
+heading 5 = h5
+heading 6 = h6