Transform single \n into node

hi! html texts and markdown formats differ. i would like to synchronise them. the thing is: single \n is blocking me. it doesn’t transfer it to the new line which means it doesn’t create new node paragraph. can i somehow do this: for example, i get an “foo\nbar” text and it will be formed like this:

<p>foo</p>
<p>bar</p>

but the value will remain “foo/nbar”?