X-Git-Url: https://ruin.nu/git/?p=yawbih.git;a=blobdiff_plain;f=Main.hs;h=324241616b6b4c462ceceddd58b41fb525af98e1;hp=2457b058632e32edc520c090bf631d33f86b5063;hb=ee02e144cc032d02afc0aaf3b1e73a1a68963ac6;hpb=b9ff8d1cc183f8f07056efb4680b8b56556d4246 diff --git a/Main.hs b/Main.hs index 2457b05..3242416 100644 --- a/Main.hs +++ b/Main.hs @@ -118,6 +118,19 @@ ex ((Bold d):xs) = do ex ((Emph d):xs) = do em (ex d) ex xs +ex ((Heading n d):xs) = do + heading n $ ex d + ex xs +ex ((Url l):xs) = do + hlink (URL {unURL = ("wiki?"++l)}) (text l) + ex xs + +heading 1 = h1 +heading 2 = h2 +heading 3 = h3 +heading 4 = h4 +heading 5 = h5 +heading 6 = h6 ex2 [] = [] ex2 ((Paragraph):xs) = "

"++ex2 xs @@ -125,6 +138,8 @@ ex2 ((Text s):xs) = s++ex2 xs ex2 ((Link l d):xs) = ""++ex2 xs ex2 ((Bold d):xs) = ""++ex2 d++""++ex2 xs ex2 ((Emph d):xs) = ""++ex2 d++""++ex2 xs +ex2 ((Heading n d):xs) = ""++ex2 d++""++ex2 xs +ex2 ((Url l):xs) = ""++ex2 xs test s = case parse wikiParser "" s of