Sometimes you want to write something with broken lines and you write in the editor:
That’s right I’m Sokka
It’s pronounced with an Okka
Young Ladies, I rocked ya!
But it ends up looking like this:
That’s right I’m Sokka It’s pronounced with an Okka Young Ladies, I rocked ya!
The fix is to add two spaces between the final character and the carriage return.
I don’t understand what the problem is. CR should be easy enough to translate, and the users intentions are clearly confirmed because they’re looking right at what the expect it to look like when they hit submit.
Why does the user have to add two spaces? Why is the universe like this?
folekaule@lemmy.world 41 minutes ago
There is a theory in UX that says that it is a bad design when it violates the users expectations of how they think it should work. In this case, the interface may not be clear enough about what you’re actually typing. You’re not typing WYSIWYG text, as you stated in your edit, you are in fact typing source code, or more specifically: markup, in a language punningly called Markdown.
Some of the confusion in the other replies come from your use of the term Carriage Return (CR) which has a very specific meaning to programmers and does not refer to the Return/Enter key. I won’t go into that more here, since that’s another tangent.
Anyway, Markdown is designed to be a lightweight markup language, so you can focus mostly on content and apply light formatting where needed for emphasis or bolding. As such, it’s a good fit for online comments, provided the users are familiar with it, or enough contextual help is available.
Part of Markdown is that it needs two line breaks or two spaces at the end of a line to introduce a forced line break. This is just a choice the creators made of how things should work in Markdown (more on that below). In HTML, for example, you would use
<br>instead.To your question as to why go through that trouble and not just use the newline characters as-is, the most likely reason people prefer it is text editors. By allowing you to break up long passages of text with single line breaks, you don’t need to rely on the editor’s word-wrap function to keep the full lines visible in your editor.
Markdown is mostly authored more like source code than prose. Moreover, as it is “code”, it may be subject to automated reformatting that could impose its own line-length rules, etc. and that would ruin the formatting. This often results in long lines being wrapped twice: at the intended point and the forced breakpoint and it looks terrible.
The original Markdown spec by John Gruber explains it like this:
You can argue that that makes it not a good fit for online comment editing, and I would say you have a great point, but it’s also very popular and works well for the most common cases. (Especially with programmers because it has many nice features for us.)
Many web apps do allow you to switch between HTML content editing mode (WYSIWYG) and Markdown. I imagine the reason why not more apps do it is just because it’s more code to write, test, and maintain.
I usually recommend people learn more about Markdown to avoid being frustrated by the quirks, and maybe even find some handy tricks they didn’t already know. On the other side of the screen, as developers, we need to keep in mind that not everyone knows Markdown, and we need to make sure it’s obvious to users what it is they are editing and where to find information about it.
otacon239@lemmy.world 3 minutes ago
You can also
add new lines
by adding a
\characterto the end of the line before it
akunohana@piefed.blahaj.zone 28 minutes ago
🤣
You’re a gentleman and a scholar!