I'm using Text.ParserCombinators.Parsec and Text.XHtml to parse an input like this:
this is the beginning of the paragraph --this is an emphasized text-- and this is the end\n
And my output should be:
<p>this is the beginning of the paragraph <em>this is an emphasized text</em> and this is the end\n</p>
This code parses and returns an emphasized element
em = do{
;count 2 (char '-') ;
;s <- manyTill anyChar (count 2 (char '-'))
;return (emphasize << s)
}
But I don't know how to get the paragraphs with emphasized items
Any ideas?
Thanks!!