type Document = [Markup]
wikiParser :: GenParser Char st Document
-wikiParser = do
- s <- pMain
- ss <- (wikiParser <|> return [])
- return (s:ss)
+wikiParser = many1 pMain
pPara = do
pEol
return (Paragraph)
pSpace = do
- space
- return (Text " ")
+ c <- space
+ return (Text (c:[]))
pEol = char '\n' <|> do
char '\r'
s <- pString "</pre>"
return (Pre s)
-pMain = try (pHeading)
- <|> (try (pPara)
- <|> pSpace
- <|> try(pPre)
- <|> try(pBold)
- <|> try(pEmph)
- <|> try(pUnderline)
- <|> try(pStrike)
- <|> try (pLink)
- <|> try (pURL)
- <|> pOtherChar
- <|> pText)
+pMain = choice [
+ try (pHeading)
+ ,try (pPara)
+ ,pSpace
+ ,try(pPre)
+ ,try(pBold)
+ ,try(pEmph)
+ ,try(pUnderline)
+ ,try(pStrike)
+ ,try (pLink)
+ ,try (pURL)
+ ,pOtherChar
+ ,pText
+ ]
pOtherChar = do
c <- oneOf "*,;.:!?[]()'\"=-%$£<>/\\|"
return id
listKeys (PGB db) = do
- list <- selectReturnTuples db $ "SELECT keyword FROM fulltexts GROUP BY keyword ORDER BY lower(keyword)"
+ list <- selectReturnTuples db $ "SELECT keyword FROM current keyword ORDER BY lower(keyword)"
case list of
[[]] -> return []
_ -> mapM (\[key] -> return key) list