Description
We recently migrated to confluence cloud, and a new problem has shown up. It looks like line endings from the source markdown are preserved.
When using this as input (note the line endings after "magna"/"Duis"/"sint"):
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis
aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
markdown2confluence reports (note it still has the newlines):
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
---- RENDERED CONTENT END -----------------------------------
And in the response from the POST to confluence:
"body": {
"storage": {
"value": ""Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna\naliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis\naute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint\noccaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
",
Interestingly it appears this only happens for newly created pages. We also have a bunch of pages that were created on the "old" confluence and were migrated somehow to confluence cloud which don't have this issue. I am unsure what the difference is between these pages. I tried converting old pages to the new editor experience, but it does not introduce this issue.
Update: after some more testing I found that this happens for all pages that are converted to the new editor experience, and then re-published. So most likely this is different behavior depending on if you're using the old editor on a page or the new.
Given this it would seem to me that the best solution would be to have the line endings already removed when markdown2confluence renders the markdown to confluence format. Not sure about the internals and if this makes sense.