I'm using Text.ParserCombinators.Parsec and Text.XHtml to parse an input like this:
This is the first paragraph example\n with two lines\n \n And this is the second paragraph\n
And my output should be:
<p>This is the first paragraph example\n
with two lines\n</p>
<p>And this is the second paragraph\n</p>
I defined:
line= do{
;t<-manyTill (anyChar) newline
;return t
}
paragraph = do{
t<-many1 (line)
;return ( p << t )
}
But it returns:
<p>This is the first paragraph example\n
with two lines\n\n And this is the second paragraph\n</p>
What is wrong? Any ideas?
Thanks!