]> ruin.nu Git - yawbih.git/blobdiff - Wiki.hs
using table for footer
[yawbih.git] / Wiki.hs
diff --git a/Wiki.hs b/Wiki.hs
index ab89fff9de0e8c6a9a6e6bd834b67fd589d26c81..337d715eb9160b83cd94e2fa2549de67e09fd6da 100644 (file)
--- a/Wiki.hs
+++ b/Wiki.hs
@@ -37,8 +37,10 @@ type Document = [Markup]
 wikiParser :: GenParser Char st Document       
 wikiParser = do 
        s <- (try (pPara) 
-               <|> pOneEol 
-               <|> pLinkLong
+               <|> pSpace 
+               <|> try (pLinkLong)
+               <|> try (pLink)
+               <|> pOtherChar
                <|> pText)
        ss <- (wikiParser <|> return [])
        return (s:ss)
@@ -48,8 +50,9 @@ pPara = do
        pEol
        return (Paragraph)
 
-pOneEol = do
-       pEol
+
+pSpace = do
+       space 
        return (Text " ")
 
 pEol = char '\n' <|> do
@@ -58,15 +61,25 @@ pEol = char '\n' <|> do
 
 pLinkLong = do
        string "[["
-       l <- many1 $ noneOf ['|','[',']']
+       l <- many1 $ noneOf ['|']
        char '|'
-       d <- many1 $ noneOf ['|','[',']'] 
+       d <- many1 $ noneOf "]" 
        string "]]"
        return (Link l d)
+pLink = do
+       string "[["
+       l <- many1 $ noneOf "]"
+       string "]]"
+       return (Link l l)
+pOtherChar = do
+       c <- oneOf ",;.:!?[]()\'\"=-%$£<>/\\|"
+       return (Text (c:[]))
+
 pText = do
-       t <- many1 (noneOf ['\n','\r','[',']'])
+       t <- many1 alphaNum--(noneOf ['\n','\r','[',']'])
        return (Text t)
 
+
 newtype PGB = PGB DBService
 
 createPGB :: String -> String -> String -> String -> IO PGB