Closed segevfiner closed 1 year ago
We could just convert them to spaces? Soft breaks don't really do anything more than spaces in default CommonMark, do they?
Some parsers convert them to hardbreaks while some to a single space. GitHub does hardbreaks, VS Code Markdown preview does space.
I don't think it's reasonable to try to preserve them in the ProseMirror document. You can configure your markdown parser to convert them to hard breaks if you want, but converting them to a space seems reasonable default behavior. Does that sound workable?
I guess so. But I think it needs to be done by overriding the softbreak rule of prosemirror-markdown
.
P.S. It would be interesting to have the ability to rewrap the Markdown text on output to some line width using soft breaks. I wonder if this can be done.
Currently
prosemirror-markdown
converts asoftbreak
to a\n
in thetext
node, this seems to render as a line break when initially viewed, but is stripped away on the first edit of that text node. I think this is weird and unintuitive. How should this be handled better?