私はText.ParserCombinators.ParsecとText.XHtmlを使用して、次のような入力を解析しています。
これは最初の段落の例です\n 2 行\n \n これが 2 番目の段落です\n
そして、私の出力は次のようになります。
<p>This is the first paragraph example\n
with two lines\n</p>
<p>And this is the second paragraph\n</p>
私は定義しました:
line= do{
;t<-manyTill (anyChar) newline
;return t
}
paragraph = do{
t<-many1 (line)
;return ( p << t )
}
しかし、次のように返されます。
<p>This is the first paragraph example\n
with two lines\n\n And this is the second paragraph\n</p>
なにが問題ですか?何か案は?
ありがとう!