Help with prosemirror markdown and line breaks

I’ve got prose mirror working with prosemirror-markdown, I am using the normal ProseMirrorView by default but parsing and serializing with the markdown library. The issue I have is newlines in the editor are being converted to <br> tags.

My current script is here https://github.com/writeas/writefreely/blob/wysiwyg/prose/prose.js.

I did find reference to hard_break line breaks in the default markdown parser and serializer so assume I could either write something custom for parsing/serializing or maybe use a custom schema, or both.

Any help would be really appreciated.

In the example I’m seeing such newlines preserved in the editor (and visible, due to white-space: pre-wrap), but not converted to <br> tags. Could you confirm that you’re really getting hard_break nodes and that you’re not passing breaks: true to markdown-it in your MarkdownParser instance?

Thanks for the help, it turns out I was using innerText and not value for the content which was changing line breaks to brs.