Closed CodyCodes95 closed 1 year ago
@CodyCodes95 Thanks for the issue submission. Markdown doesn't have a natural way of encoding blank paragraphs because it collapses them together; however, we may be able to use a workaround where we encode a blank paragraph with " " (non breaking space).
May I ask how critical this is to your application at the moment? Thanks.
@CodyCodes95 This issue should now be resolved in 3.0.20
Consecutive paragraphs are saved as "\n\n \n\n". Technically, a non-breaking space is being inserted into the Markdown and visually we just see the extra space. When Wysimark reads that Markdown into the editor, it will recognize this as an empty paragraph and the paragraph in the editor will not include a non-breaking space which may cause weird behavior in the editor to the end user.
@thesunny You're the man! Appreciate this. Thankyou
Description When running saveMarkdown() If you have multiple enters in the editor, the markdown will be saved correctly. For example: "Three New lines up ahead \n\n\n That is three new lines".
However if you load the editor with that same string, those new lines get removed.
I want to use this for spacing. If this is not the way to do it, how can we have user submitted spacing between paragraphs? Hitting enter as many times as you want seems the most intuitive.
Reproduction
https://github.com/portive/wysimark/assets/94301860/8124114e-c6ce-44fb-a1a4-345dac01c283
Steps To reproduce the behavior:
Expectation Expect to have the new lines remain when you load them in the initial markdown.
Environment