我正在使用Text.ParserCombinators.Parsec和Text.XHtml来解析这样的输入:
this is the beginning of the paragraph --this is an emphasized text-- and this is the end\n
我的输出应该是:
<p>this is the beginning of the paragraph <em>this is an emphasized text</em> and this is the end\n</p>
此代码解析并返回一个强调的元素
em = do{
;count 2 (char '-') ;
;s <- manyTill anyChar (count 2 (char '-'))
;return (emphasize << s)
}
但我不知道如何获得带有强调项目的段落
有任何想法吗?
谢谢!!